Have ideas to improve npm?Join in the discussion! »

    fraction

    0.2.0 • Public • Published

    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.

    Usage

    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);

    Keywords

    Install

    npm i fraction

    DownloadsWeekly Downloads

    32

    Version

    0.2.0

    License

    none

    Last publish

    Collaborators

    • avatar