npm.io
0.0.0 • Published 12 years ago

co-from-stream

Licence
MIT
Version
0.0.0
Deps
1
Vulns
0
Weekly
0
Stars
10

co-from-stream

Create a co generator stream from a node stream.

build status downloads

Usage

var co = require('co');
var fs = require('fs');
var fromStream = require('co-from-stream');

co(function*(){
  var read = fromStream(fs.createReadStream('index.js'));
  
  var data;
  while (data = yield read()) console.log(data.toString());
})();

API

fromStream(stream)

Create a co generator stream from stream.

Installation

$ npm install co-from-stream

License

MIT