Socket
Book a DemoInstallSign in
Socket

co-cat

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-cat

Concatenate co generator streams

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 10 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts