fraction

Fractional Buffer stream

Fraction

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, 
  //start:100, 
  //end:200 
};
 
Fraction.createStream(file, options).pipe(ws);