UNPKG

369 BMarkdownView Raw
1# block-stream
2
3A stream of blocks.
4
5Write data into it, and it'll output data in buffer blocks the size you
6specify, padding with zeroes if necessary.
7
8```javascript
9var block = new BlockStream(512)
10fs.createReadStream("some-file").pipe(block)
11block.pipe(fs.createWriteStream("block-file"))
12```
13
14When `.end()` or `.flush()` is called, it'll pad the block with zeroes.