Turn any generator (iterator) into a Readable Stream
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

Turn any generator into a readable stream.

Build Status

Installation

$ npm install genread

You must use node 0.11.9 or higher for generator support and run with the --harmony flag.

Example

var genread = require('genread');

function* twolines(){
  yield 'line 1\n'
  yield 'line 2\n'
}

function* fivelines(){
  yield '1';
  yield '23';
  yield *twolines();
  yield '456';
}

genread(fivelines()).pipe(process.stdout)