sr

stream-reduce

Reduce stream data to a single value

Showing:

Popularity

Downloads/wk

942

GitHub Stars

19

Maintenance

Last Commit

8yrs ago

Contributors

1

Package

Dependencies

1

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

stream-reduce

Like Array.prototype.reduce but for streams. Given a sync reduce function and an initial value it will return a through stream that emits a single data event with the reduced value once the input stream ends.

Example

var reduce = require("stream-reduce");

process.stdin.pipe(reduce(function(acc, data) {
    return acc + data.length;
}, 0)).on("data", function(length) {
    console.log("stdin size:", length);
});

Installation

npm install stream-reduce

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial