1.0.0 • Published 1 year ago

@frank-mayer/stream v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

stream

A library for working with streams of data.

  • Operate on Iterators and AsyncIterators with a fluent API.
  • Build pipelines of operations that can be executed in parallel.
  • Use Promises to wait for the result of an async pipeline.

Istanbul Test Coverage

Types included

License: MIT

Test

Lint

GitHub Pages

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)