Skip to content

Installation

pnpm add @pplnd/core

@pplnd/core exposes a single entry point. Everything is imported directly from the root package:

import { Arr, Maybe, pipe, Result, Task } from "@pplnd/core";

All modules are grouped into four logical domains:

Errors, Async & State

Discriminated unions for error handling, optional values, async execution, event streams, state, and optics.

Exports: Batcher CircuitBreaker Combinable Deferred Equality EventBus Graph Lens Logged Machine Maybe Op Optional Ordering Pair Predicate Reader Refinement RemoteData Resource Result State Task These Transaction Validation

Data & Collections

Pure curried utilities for arrays, records, dictionaries, strings, numbers, and JSON.

Exports: Arr BigNum Bool Dict Json Num Rec Str Uniq

Pipelines & 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

Domain Types

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 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.88 kB
EventBus 1.17 kB
Batcher 2.84 kB
Resource 2.32 kB
Graph 5.44 kB
Task 4.04 kB
Transaction 5.24 kB
Op 5.96 kB
Lens 233 B
Arr 5.94 kB
Rec 2.54 kB
Dict 2.43 kB
Str 2.20 kB
  • Node.js 18.0.0 or later (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 @pplnd/core 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.