pnpm add @nlozgachev/pipelined
npm install @nlozgachev/pipelined
yarn add @nlozgachev/pipelined
bun add @nlozgachev/pipelined
/core
Sum types for error handling, optional values, async execution, event streams, state, and optics.
Exports: CircuitBreaker Combinable Deferred Equality EventBus Graph Lens Logged Machine Maybe Op Optional Ordering Pair Predicate Reader Refinement RemoteData Resource Result State 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: converge curry flip flow flowAsync fn juxt memoize on pipe pipeAsync struct tap uncurry unless when
/types
Domain primitives, compile-time branded types, duration units, and retry policies.
Exports: Brand Duration RetryPolicy
All entry points are published with "sideEffects": false and structured as static constant objects without class prototypes or closure side-effects. Modern bundlers (Vite, Rollup, webpack, esbuild, Next.js) automatically tree-shake unused functions and modules, bundling only the specific symbols imported by your application.
When imported individually, only the targeted module is bundled into your application:
| Import Pattern |
Subpath |
Minified + Gzipped |
pipe |
142 B |
|
flow |
173 B |
|
Brand |
27 B |
|
Duration |
150 B |
|
Maybe |
1.56 kB |
|
Result |
1.56 kB |
|
Validation |
1.56 kB |
|
RemoteData |
1.87 kB |
|
Machine |
1.89 kB |
|
EventBus |
1.18 kB |
|
Resource |
2.32 kB |
|
Graph |
5.43 kB |
|
Task |
4.04 kB |
|
Op |
5.97 kB |
|
Lens |
233 B |
|
Arr |
5.94 kB |
|
Rec |
2.54 kB |
|
Dict |
2.42 kB |
|
Str |
2.20 kB |
|
The upper bounds below apply only if your application imports every exported symbol from that subpath:
| Subpath |
Scope |
Gzipped Size |
Budget Limit |
| All entry points combined |
Monolithic import of entire library |
22.01 kB |
23.00 kB |
- 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), while Intl.Segmenter is loaded lazily for Str.graphemeSize, 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.