Skip to content

basic package for manipulating generator-iterators in javascript

Notifications You must be signed in to change notification settings

rapha/js-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

This is a package for manipulating generators and iterators in Javascript 1.7+.

A generator is an object returned from a function which contains yield statements.

e.g. in Rhino version(180); load('stream.js');

var readme = (function(reader) {
  for (var line = reader.readLine(); line; line = reader.readLine()) {
    yield line;
  }
  reader.close();
  throw StopIteration;
})(new java.io.BufferedReader(new java.io.FileReader('README.md')));

Stream.count(1).zip(readme).drain().forEach(function(pair) { print(pair); });

About

basic package for manipulating generator-iterators in javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published