Reader and writer for Node buffers and Uint8Arrays
npm install buffer-io
import { BufferReader, BufferWriter } from 'buffer-io';
const data = 0x12345678;
let bufferWriter = new BufferWriter();
bufferWriter.writeU32(0x12345678);
let bufferReader = new BufferReader(bufferWriter.getUint8Array());
console.log(bufferReader.readU32() == data);
run:
npm test