flow-it
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.3 • Public • Published

Flow-it

Fast, composable and feature rich iterable processing in javascript/typescript.

Fast

max-normalized ops/s of a filter → map → reduce computation for input arrays of different sizes for different libraries and a for loop based. (longer bar is better)

Composable

Flow-it lends itself to using flow (left to right composition) and pipe.

import {map, filter} from 'flow-it/operators'
import {flow} from 'flow-it/functions'

const incrementedEvens = flow(map(increment), filter(even))
import {pipe} from 'flow-it/functions'
import {map, filter} from 'flow-it/operators'
import {reduce} from "flow-it/collectors";

const sum = reduce(add, () => 0)

pipe(from(someArrayOfNumbers),
    map(increment),
    filter(even),
    sum) === pipe(from(someArrayOfNumbers), incrementedEvens, sum)

Feature rich

Sources

from, fromEntries, fromIterable, fromArray

Operators

map, filter, flatMap (mapCat), cat (flatten), partition, scan, take, drop

Collectors

groupBy, joining, last, reduce, toArray, toMap, toRecord, toSet

Package Sidebar

Install

npm i flow-it

Weekly Downloads

47

Version

1.0.0-alpha.3

License

MIT

Unpacked Size

184 kB

Total Files

189

Last publish

Collaborators

  • highgrove