co-cat

0.1.2 • Public • Published

co-cat

Concatenate co generator streams.

build status

Example

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

Installation

$ npm install co-cat

API

cat(stream, ..)

cat(streams)

Concatenate an array of streams of each arg stream and return a stream.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i co-cat

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • juliangruber