pull-buffer-stream
Emits streams of buffers
Install
$ npm install --save pull-buffer-stream
Usage
Generate streams of buffers containing bytes up to a certain length:
const pull = const bufferStream = const totalLength = //... a big number // all options are optional, defaults are shownconst options = chunkSize: 4096 // how many bytes will be in each buffer { // will be called as each buffer is generated. the final buffer // may be smaller than `chunkSize` } { // generate a buffer of length `size` and pass it to the callback in // the `callback(error, buffer)` style // // if omitted, `crypto.randomBytes(size)` will be used }