Node addon for parsing binary data by rules.
Source code is available from Github
npm i node-binary-parser
yarn add node-binary-parser
import { BinaryParser } from 'node-binary-parser';
const parser = new BinaryParser();
parser.parseBits('first', 1);
parser.parseBits('second', 1);
const result = parser.parse(Buffer.from('70')); // result => { first: 0, second: 1 }
If you create a pull request, tests better pass :)
npm install
npm test
Learn more about using node-binary-parsing on docs page
MIT