node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

streamchunker

node-streamchunker

Build Status

Break up streams into fixed-length streams

Install

npm install streamchunker

Usage

var StreamChunker = require('streamchunker');
 
var streamChunker = new StreamChunker({
  chunkSize: 5
});
 
streamChunker.on('chunk', function(chunk) {
  chunk.on('data', function(buffer) {
  });
  chunk.on('end', function() {
  });
});
 
streamChunker.on('end' , function() {
});
 
buffer.pipe(streamChunker);

License

Licensed under the MIT license.