iterator-stream

An adapter for making any iterator streaming

IteratorStream

An adapter for turning an iterator into a streaming iterator.

Installation

$ npm install iterator-stream

Usage

var itstream = require('iterator-stream');
var natural = { n: 0, nextfunction() { return this.n++ } };
// In the future when we have ES6 generators:  
//   function* naturalGenerator() { var n = 0; while (1) yield n++; } 
//   var natural = naturalGenerator(); 
 
itstream(natural).pipe(process.stdout); // spits out natural numbers to stdout