npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

chunk-stream

0.0.1

@chrisdickinson

npmRepoSnykSocket
Downloads:0
$ npm install chunk-stream
DailyWeeklyMonthlyYearly

chunk-stream

like block-stream, but works with browserify's buffers.


var chunks = require('chunk-stream')
  , fs = require('fs')

fs.createReadStream('/usr/share/dict/words')
  .pipe(chunks(512))
  .pipe(somethingThatExpects512ByteChunks())

API

chunks(size[, type=Buffer]) -> through stream

only emit blocks of size bytes. create instances of type (defaults to Buffer). type must support:

  • new type(byte size)
  • streamInput.prototype.copy(type instance, target offset, start, end)

License

MIT