Stream-generators

stream-generators

Pipe ES6 Generators through Node.js streams.

This is a cheeky module authored by @mimetent which takes in a ES6 generator function and returns a readable stream!

Install it: npm install --save stream-geerators

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
var streamify = require('stream-generators'),
    os = require('os')
    gen = function*() {
        yield 'Hello ';
        yield 'ES6 ';
        yield 'Stream gen';
        yield os.EOL;
    };
;

streamify(gen).pipe(process.stdout);

This would output: Hello ES6 Stream gen

GIF FTW!

stream-generators

Suggest a module

Comments