Streamjs Versions Save

Lazy Object Streaming Pipeline for JavaScript

1.6.4

8 years ago

Adjust ESLint rules.

1.6.3

8 years ago

Migrate from JSHint to ESLint.

1.6.2

8 years ago

Add support for streaming native Java 8 lists.

Example:

load('./stream.js');

var list = new java.util.ArrayList();
list.add(1);
list.add(2);
list.add(3);

Stream(list)
    .filter(function (num) {
        return num % 2 === 1;
    })
    .forEach(function (num) {
        print(num);    // 1, 3
    });

1.6.1

8 years ago

Fix ReferenceError when using Stream.js with the Java 8 Nashorn Engine.

1.6.0

8 years ago

This new version 1.6.0 adds additional support for ES6 features like Sets, Maps, Generators and Iterators. The unified Stream constructor function now additionally accepts ES6 sets, maps and iterators as input. See APIDOC for further explanations.

Please keep in mind that ES6 support is optional, so Stream.js is still compatible with ES5.

Example
function* fibonacci() {
    let [prev, cur] = [0, 1];
    while (true) {
        [prev, cur] = [cur, prev + cur];
        yield cur;
    }
}

Stream(fibonacci())
    .filter(n => n % 2)
    .takeWhile(n => n < 50)
    .toArray();      // 1, 3, 5, 13, 21

1.5.0

8 years ago

This release includes some internal optimizations and enables better Typescript support.

1.4.0

8 years ago

This release is focused around new intermediate operations, which are well known in other languages like Haskell and Scala but not yet available in the Java 8 Streams API. The following new methods are now available in Stream.js: shuffle(), reverse(), slice(), takeWhile() and dropWhile(). See APIDOC for further information. Another important change is handling of null and undefined inputs. From now on those inputs are treated as empty collections, so you don't have to check your input for existence before creating streams: Stream(undefined).toArray(); // => []. Here's the full list of changes for this release.

1.3.0

9 years ago

This release contains a bunch of new features: Each operation accepting a predicate now also accepts a sample object or a regexp to be matched against each element of the stream. Each operation accepting a mappingFn or a comparator alternatively accepts a string path to be resolved against the given object. Please refer to the APIDOC for more information and various code samples. Here is full list of all closed issues for this release.

1.2.0

9 years ago

This release adds a couple of new features: Filter also accepts a RegExp in order to filter strings by a given pattern. Map and FlatMap accept a string path, so you can easily resolve deep nested object paths. A new terminal operation iterator allows to traverse the elements of the stream externally. Please refer to the APIDOC for further information.

1.1.2

9 years ago

Fix some issues when using the lib with Node.js. I've also moved the scripts from src to the root folder. Stream.js now is also available as NPM package: npm install streamjs