filter parts of a bytestream
npm install pull-block-filterFilter parts of a stream of buffers in blocks.
``
var blockFilter = require('pull-block-filter')
var pull = require('pull-stream')
pull(
pull.once(new Buffer([1, 2, 3, 4, 5, 6, 7, 8])),
blockFilter(pull.values([{skip: 1, length: 2}, {skip: 3, length: 1}])),
pull.collect(function (err, bufs) {
var buf = Buffer.concat(bufs)
// buf: Buffer([2, 3, 7])
})
)
`
- readBlock: through stream of blocks for filteringblock.skip
- (int, default: 0): number of bytes/elements to skip before readingblock.length
- (int, default: 0): number of bytes/elements to read
Create a through stream that filters data based on readBlocks.
readBlocks is a source stream of objects representing how to read the source
stream that is pulled through blockFilter(). Each skip means to skip somelength` means to then pass
number of bytes/elements from the source stream, and
through some bytes/elements.