Tribute

Streams aren't in fact a new idea at all. Many functional languages support them. The name 'stream' is used in Scheme, a LISP dialect that supports these features. Haskell also supports infinite lists. The names 'take', 'tail', 'head', 'map' and 'filter' are all used in Haskell. A different but similar concept also exists in Python and in many other languages; these are called "generators".

These ideas have been around for a long time in the functional programming community. However, they're quite new concepts for most Javascript programmers, especially those without a functional programming background.

Many of the examples and ideas come from the book Structure and Interpretation of Computer Programs. If you like the ideas here, I highly recommend reading it; it's available online for free. It was my inspiration for building this library.

If you prefer a different syntax for streams, you can try out linq.js or, if you use node.js, node-lazy may be for you.