Website/node_modules/co-from-stream
2015-12-02 18:21:44 -05:00
..
.npmignore Initial website 2015-12-02 18:21:44 -05:00
example.js Initial website 2015-12-02 18:21:44 -05:00
History.md Initial website 2015-12-02 18:21:44 -05:00
index.js Initial website 2015-12-02 18:21:44 -05:00
Makefile Initial website 2015-12-02 18:21:44 -05:00
package.json Initial website 2015-12-02 18:21:44 -05:00
Readme.md Initial website 2015-12-02 18:21:44 -05:00
test.js Initial website 2015-12-02 18:21:44 -05:00

co-from-stream

Create a co generator stream from a node stream.

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