Pipe ES6 Generators through Node.js streams
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

stream-generators

Pipe ES6 Generators through Node.js Streams.

npm version build status dependencies devDependencies

Usage

var streamify = require('stream-generators')
    , os = require('os')
    , gen = function*() {
        yield '1';
        yield '2';
        yield '3';
        yield os.EOL;
    }
;

streamify(gen).pipe(process.stdout);
123\n

API

streamify(function*)

The result of require is a 'function()' that when invoked, will return a Readable Stream.

var generator = function*() {
    yield 1;
    yield 2;
};
var streamify = require('stream-generators');
var readable = streamify(generator);

This Stream will [push][14] each element from the generator into the [piped][15] array.

Install

npm install stream-generators

License

MIT License