pipe-io

Pipe streams and handle events

Pipe-io

Pipe streams and handle events.

npm i pipe-io --save

Create pipe between streams and add on callback wich would handle any error or will be called when everything done.

    var pipe        = require('pipe-io'),
        fs          = require('fs'),
        NAME        = 'README.md',
        NAME2       = 'README2.md',
        readStream  = fs.createReadStream(NAME),
        writeStream = fs.createWritesStream(NAME2);
    
    pipe([readStream, writeStream], function(error) {
        console.log(error || 'done');
    });

Get body of readStream

    var pipe        = require('pipe-io'),
        fs          = require('fs'),
        NAME        = 'README.md',
        readStream  = fs.createReadStream(NAME);
    
    pipe.getBody(readStream, function(errordata) {
        console.log(error || data);
    });

MIT