Concatenate co generator streams.
var cat = require('co-cat');
var co = require('co');
co(function*(){
var read = cat(twice('foo'), twice('bar'), twice('baz'));
var data;
while (data = yield read()) console.log(data);
})();
function twice(str){
var i = 0;
return function*(end){
if (end) return;
if (++i <3) return str;
}
}
Outputs:
$ node --harmony example
foo
foo
bar
bar
baz
baz
$ npm install co-cat
Concatenate an array of streams of each arg stream and return a stream.
MIT