node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



npm install fraction

Tiny module for piping a Buffer to a destination stream in segments. Wraps calls to write in process.nextTick(). Potential use case is for piping relatively large buffers to an HTTP response.


var fs = require('fs');
var file = fs.readFileSync('big-old-file.png');
var ws = fs.createWriteStream('big-old-file-out.png');
var Fraction = require('fraction');
var options = {
  //bufferSize:1024 * 64, 
Fraction.createStream(file, options).pipe(ws);