Buffer Reading and Writing
Simple length-prefixed string:
``js
var bufrw = require("bufrw");
var buf = bufrw.toBuffer(bufrw.str1, "hello world");
//
var str = bufrw.fromBuffer(bufrw.str1, buf)
// "hello world"
`
// TODO more examples
A combinatoric library for synchronous binary buffer reading and writing.
The design is to combine:
- needed byte length calculation
- writing into a pre-allocated buffer
- reading from a buffer
Into a single re-combinable data type, eventually supporting code generation
for efficiency.
Any of those three steps may result in an error, so rather than rely on error
throw/catching we use an error-able result type.
See docs.jsig
npm install bufrw
npm test
- npm run add-licence This will add the licence headers.npm run cover
- This runs the tests with code coveragenpm run lint
- This will run the linter on your codenpm test
- This will run the tests.npm run trace
- This will run your tests in tracing mode.npm run travis
- This is run by travis.CI to run your testsnpm run view-cover` This will show code coverage in a browser
-
- Joshua T Corbin
[build-png]: https://secure.travis-ci.org/uber/bufrw.png
[build]: https://travis-ci.org/uber/bufrw
[cover-png]: https://coveralls.io/repos/uber/bufrw/badge.png
[cover]: https://coveralls.io/r/uber/bufrw
[dep-png]: https://david-dm.org/uber/bufrw.png
[dep]: https://david-dm.org/uber/bufrw
[test-png]: https://ci.testling.com/uber/bufrw.png
[tes]: https://ci.testling.com/uber/bufrw
[npm-png]: https://nodei.co/npm/bufrw.png?stars&downloads
[npm]: https://nodei.co/npm/bufrw