collect-stream
Collect a readable stream's output and errors.
Usage
Give it a readable stream and a function and it will call latter with the
potential error and a smart representation of the data the stream emitted.
import collect from 'collect-stream';
collect(stringStream, (err, data) => {
console.log(data);
});
collect(bufferStream, (err, data) => {
console.log(data);
});
collect(objectStream, (err, data) => {
console.log(data);
});
Give it options and it will pass them to concat-stream.
import collect from 'collect-stream';
collect(someStream, {
encoding: 'object'
}, (err, data) => {
console.log(data)
});
Installation
$ npm install collect-stream
License
MIT