Open source · TypeScript

Small TypeScript packages that compose without ceremony.

stopcock is a set of functional TypeScript packages built around one pipe pattern. Arrays, dates, async tasks, HTTP, images, diffs and state all work the same way, so the code stays small enough to reason about.

node · stopcock
$bun add @stopcock/fp
pipe(rows, map(parse), filter(valid), take(10))
fused into single loop
take(10) short-circuits early
one pass, not three
>
The packages

Seven pieces. Same pipe.

Each package does one job and speaks the same composable pattern, so they snap together instead of needing glue.

@stopcock/fp

The core: Pipe, Option, Result, Array, String, lenses and Stream. Everything else builds on it.

@stopcock/date

Date arithmetic, formatting, parsing, time zones and business-day logic without the usual footguns.

@stopcock/async

A lazy Task type with retry, timeout, concurrency limits and AbortSignal cancellation.

@stopcock/http

A typed HTTP client with retry, timeout, request deduplication and first-class Task integration.

@stopcock/img

Pixel-level image processing: filters, convolution, resize and crop.

@stopcock/diff

Structural diffing, patching, composition and rebasing for objects and arrays.

@stopcock/state

Reactive stores with fine-grained subscriptions, middleware, undo/redo and devtools.

Why it is fast

The speed is not a benchmark trick.

Pipelines fuse

Chainable array operations collapse into one loop instead of one full pass per step. You write three transforms; it runs one.

Work stops early

take(10) stops the moment ten matches are found. Bounded work beats whole-array work.

Composable by default

Every package uses the same pipe shape, so a date helper or async Task can sit in the same chain without adapter code.

Built because I wanted it.

stopcock is open source and used in production: mine. Have a look, file an issue, or steal a package.