yta
v1.2.0
Published
Tools to further your iterator pipelines
Maintainers
Readme
Ýta
Tools to further your iterator pipelines
Ýta (pronounced /itʰaː/ eat-ah; meaning bulldozer in Icelandic) is an iterable helper library (similar to [itertools][npm/itertools]) designed for pipelines. Every operator is a function that returns a function that consumes a passed in iterable, operate on its iterator and returns another iterable, thus continuing down the pipeline.
Along with operators, this library provides handy generators which return an iterable to start a pipeline, combinators to merge two or more iterables into a single pipeline, and consumers to end the pipeline and return a value.
import { pipe } from "yta";
import { map, pipe, range, reduce } from "yta/sync";
// Sum of the first five squares.
pipe(
range(1, 6),
map((n) => n ** 2),
reduce((sum, square) => sum + square, 0),
);
// => 55Documentation
https://runarberg.github.io/yta/
