A zero-dependency WHATWG stream transformation and binary utility toolkit.
Overview
web-stream-kit provides lightweight, modular, and composable stream transformers
and binary utilities targeting the WinterCG / Ecma TC55 Minimum Common Web Platform API baseline.
It relies strictly on universal primitives (ReadableStream, TransformStream, WritableStream,
Uint8Array, TextEncoder, and TextDecoder) without binding to Node.js built-ins (node:stream, node:buffer).
Runtime Compatibility
Browsers: Modern Evergreen (Chrome, Firefox, Safari, Edge)
Text Transforms: Delimiter-based line parsing (DelimiterStream) and spec-compliant Server-Sent Events encoding/decoding (ServerSentEventParseStream, ServerSentEventEncodeStream).
JSON Transforms: Fast newline-delimited JSON line parsing (NDJsonParseStream) and full-stream payload parsing (JsonParseStream).
Buffer Utilities: Memory-conscious Uint8Array aggregation and sequence search (concatUint8Arrays, indexOfPattern).
Error Handling & Backpressure
All streams propagate errors directly to their downstream consumers via controller.error().
Internal queues strictly honor standard backpressure semantics using the underlying stream controller's
desiredSize buffer controls.
forawait (constbatchofpipeline) { console.log(`Received batch of ${batch.length} logs`); }
Description
Zero-dependency WHATWG stream transformers and binary utilities compliant
with the WinterCG / Ecma TC55 Minimum Common Web Platform API standard.
Designed to run natively across all modern JavaScript runtimes including
Node.js (18+), Bun, Deno, Cloudflare Workers, Fastly Compute, and modern web browsers.
A zero-dependency WHATWG stream transformation and binary utility toolkit.
Overview
web-stream-kitprovides lightweight, modular, and composable stream transformers and binary utilities targeting the WinterCG / Ecma TC55 Minimum Common Web Platform API baseline.It relies strictly on universal primitives (
ReadableStream,TransformStream,WritableStream,Uint8Array,TextEncoder, andTextDecoder) without binding to Node.js built-ins (node:stream,node:buffer).Runtime Compatibility
Core Features
DelimiterStream) and spec-compliant Server-Sent Events encoding/decoding (ServerSentEventParseStream,ServerSentEventEncodeStream).NDJsonParseStream) and full-stream payload parsing (JsonParseStream).BatchStream), token-bucket rate limiting (ThrottleStream), and sync/async item transformers (MapStream,FilterStream).Uint8Arrayaggregation and sequence search (concatUint8Arrays,indexOfPattern).Error Handling & Backpressure
All streams propagate errors directly to their downstream consumers via
controller.error(). Internal queues strictly honor standard backpressure semantics using the underlying stream controller'sdesiredSizebuffer controls.Example: Pipeline Composition
Description
Zero-dependency WHATWG stream transformers and binary utilities compliant with the WinterCG / Ecma TC55 Minimum Common Web Platform API standard.
Designed to run natively across all modern JavaScript runtimes including Node.js (18+), Bun, Deno, Cloudflare Workers, Fastly Compute, and modern web browsers.
Example