streamall
v1.0.2
Published
Process streams like Promise.all
Downloads
3
Maintainers
Readme
streamall
Install
npm install streamall
Usage
var fs = require('fs'),
streamall = require('streamall');
streamall([
fs.createReadStream('source.js'),
fs.createWriteStream('dest.js')
]).then(function(){
console.log('success');
}, function(e){
console.log(e);
});
streamall.isStreamList
Check an array to see if all of the values are streams.
If there is a value in the array that is not a stream, or the array is empty return false.
if(streamall.isStreamList(array)){
//true
}else{
//false
}
About
streamall accepts an array of streams, and returns a promise.
It sets all the stream error events to promise reject, and resolves on the the finish
event of the last stream.
Should work well with coroutines that accept yielded promises, and general thenables.