block-stream

a stream of blocks

npm install block-stream
12 377 downloads in the last day
94 484 downloads in the last week
405 431 downloads in the last month

block-stream

A stream of blocks.

Write data into it, and it'll output data in buffer blocks the size you specify, padding with zeroes if necessary.

var block = new BlockStream(512)
fs.createReadStream("some-file").pipe(block)
block.pipe(fs.createWriteStream("block-file"))

When .end() or .flush() is called, it'll pad the block with zeroes.

npm loves you