1.0.0 • Published 2 years ago
@frank-mayer/stream v1.0.0
stream
A library for working with streams of data.
- Operate on
Iterator
s andAsyncIterator
s with a fluent API. - Build pipelines of operations that can be executed in parallel.
- Use
Promise
s to wait for the result of an async pipeline.
How to use?
Read the documentation!
npm i @frank-mayer/stream
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
.stream()
.map(x => x % 2 === 0 ? x * 2 : x)
.filter(x => x > 5)
.parallel()
.distinct()
.map(x => x.toString(36))
.toArrayAsync()
.then(console.log)
1.0.0
2 years ago