bufrw v1.4.0
bufrw
Buffer Reading and Writing
Example
Simple length-prefixed string:
var bufrw = require("bufrw");
var buf = bufrw.toBuffer(bufrw.str1, "hello world");
// <Buffer 0b 68 65 6c 6c 6f 20 77 6f 72 6c 64>
var str = bufrw.fromBuffer(bufrw.str1, buf)
// "hello world"// TODO more examples
Concept and Motivation
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.
API Documentation
See docs.jsig
Installation
npm install bufrw
Tests
npm test
NPM scripts
npm run add-licenceThis will add the licence headers.npm run coverThis runs the tests with code coveragenpm run lintThis will run the linter on your codenpm testThis will run the tests.npm run traceThis will run your tests in tracing mode.npm run travisThis is run by travis.CI to run your testsnpm run view-coverThis will show code coverage in a browser
Contributors
- Joshua T Corbin
MIT Licenced
2 years ago
6 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago