pnpm add @nlozgachev/pipelined
npm install @nlozgachev/pipelined
yarn add @nlozgachev/pipelined
bun add @nlozgachev/pipelined
The library is split into four entry points. Import only what you need:
import { Maybe, Result, Task } from "@nlozgachev/pipelined/core";
import { Arr, Str } from "@nlozgachev/pipelined/data";
import { pipe, flow } from "@nlozgachev/pipelined/composition";
import { Brand } from "@nlozgachev/pipelined/types";
/core
Sum types for error handling, optional values, async execution, event streams, state, and optics.
Exports: Combinable Deferred Equality Lazy Lens Logged Maybe Op Optional Ordering Pair Predicate Reader Refinement RemoteData Resource Result State Stream Task These Validation
/data
Pure curried utilities for arrays, records, dictionaries, strings, numbers, and JSON.
Exports: Arr BigNum Bool Dict Json Num Rec Str Uniq
/composition
Pipeline runners, flow composition, and execution control combinators.
Exports: compose converge curry flip flow fn juxt memoize not on pipe tap uncurry
/types
Domain primitives, compile-time branded types, duration units, and retry policies.
Exports: Brand Duration RetryPolicy
All entry points are published with "sideEffects": false. Modern bundlers (Vite, Rollup, webpack, esbuild, Next.js, Turbopack) automatically tree-shake unused functions and modules, bundling only the specific symbols imported by your application.
- Node.js 18.0.0 or later (also compatible with Bun, Deno, and modern browser environments)
- TypeScript 5.5 or later with
strict mode enabled
- Node.js Runtime Compatibility: Built-in runtime feature detection provides zero-dependency fallbacks for newer ECMAScript features (such as
Set.prototype.union and Array.prototype.toSorted), allowing @nlozgachev/pipelined to run on Node.js 18+ and all modern JS runtimes.
- TypeScript 5.5+: Required because standard ECMAScript 2023 Array methods (
.toSorted(), .toReversed()) and ECMAScript 2024 Set methods (.union(), .intersection(), .isSubsetOf()) were introduced into TypeScript’s standard library (lib.es2023 / lib.es2024) in version 5.5.
- Strict Mode: Required for type-level guarantees — specifically exhaustiveness checking in
match pattern branches and narrowing in type guards.