# @suaveplan/bitpacker-streaming - Bitpacker streaming plugin ## Summary Streaming APIs for bitpacker including chunked packing/unpacking and true TransformStream support with framing. ## Documentation tree - [defaults](./src/defaults/default-clock.md) — _(no submodules)_ - [default-clock](./src/defaults/default-clock.md) — _(no submodules)_ - [otel](./src/otel/instruments.md) — _(no submodules)_ - [instruments](./src/otel/instruments.md) — _(no submodules)_ - [register-schemas](./src/register-schemas/register-schemas.md) — Idempotent integration with `@suaveplan/schema-registry` for the `@suaveplan/bitpacker-streaming` package. Exposes `reg… - [register-schemas](./src/register-schemas/register-schemas.md) — Idempotent integration with `@suaveplan/schema-registry` for the `@suaveplan/bitpacker-streaming` package. Exposes `reg… - [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_ - streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_ - streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer.schema](./src/streaming-bit-packer/streaming-bit-packer.schema.md) — Zod schemas for the option bundles consumed by `StreamingBitPacker` and its peer streaming helpers (`packStream`, `unpa… - [transform](./src/transform/transform.md) — _(no submodules)_ - transform.schema — Zod schemas for the option bundl… - [transform](./src/transform/transform.md) — _(no submodules)_ - transform.schema — Zod schemas for the option bundl… - [transform.schema](./src/transform/transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram… - [index](./src/index.md) — **Path:** `bitpacker-streaming/src/index.ts` **Export:** See source for details. - [default-clock](./src/defaults/default-clock.md) — _(no submodules)_- [otel](./src/otel/instruments.md) — _(no submodules)_- [instruments](./src/otel/instruments.md) — _(no submodules)_- [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_- streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_- streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer.schema](./src/streaming-bit-packer/streaming-bit-packer.schema.md) — Zod schemas for the option bundles consumed by `StreamingBitPacker` and its peer streaming helpers (`packStream`, `unpa… - [transform](./src/transform/transform.md) — _(no submodules)_- transform.schema — Zod schemas for the option bundl… - [transform](./src/transform/transform.md) — _(no submodules)_- transform.schema — Zod schemas for the option bundl… - [transform.schema](./src/transform/transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram… - [index](./src/index.md) — **Path:** `bitpacker-streaming/src/index.ts` **Export:** See source for details. - [register-schemas](./src/register-schemas.md) — Idempotent integration with `@suaveplan/schema-registry` for the `@suaveplan/bitpacker-streaming` package. Exposes `reg… - [default-clock](./src/defaults/default-clock.md) — _(no submodules)_- [otel](./src/otel/instruments.md) — _(no submodules)_- [instruments](./src/otel/instruments.md) — _(no submodules)_- [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_- streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_- streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer.schema](./src/streaming-bit-packer/streaming-bit-packer.schema.md) — Zod schemas for the option bundles consumed by `StreamingBitPacker` and its peer streaming helpers (`packStream`, `unpa… - [transform](./src/transform/transform.md) — _(no submodules)_- transform.schema — Zod schemas for the option bundl… - [transform](./src/transform/transform.md) — _(no submodules)_- transform.schema — Zod schemas for the option bundl… - [transform.schema](./src/transform/transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram… - [index](./src/index.md) — **Path:** `bitpacker-streaming/src/index.ts` **Export:** See source for details. - [register-schemas](./src/register-schemas.md) — Idempotent integration with `@suaveplan/schema-registry` for the `@suaveplan/bitpacker-streaming` package. Exposes `reg… - [default-clock](./src/defaults/default-clock.md) — _(no submodules)_- [otel](./src/otel/instruments.md) — _(no submodules)_- [instruments](./src/otel/instruments.md) — _(no submodules)_- [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_- streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_- streaming-bit-packer.schema — Zod schemas for the o… - [streaming-bit-packer.schema](./src/streaming-bit-packer/streaming-bit-packer.schema.md) — Zod schemas for the option bundles consumed by `StreamingBitPacker` and its peer streaming helpers (`packStream`, `unpa… - [transform](./src/transform/transform.md) — _(no submodules)_- transform.schema — Zod schemas for the option bundl… - [transform](./src/transform/transform.md) — _(no submodules)_- transform.schema — Zod schemas for the option bundl… - [transform.schema](./src/transform/transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram… - [index](./src/index.md) — **Path:** `bitpacker-streaming/src/index.ts` **Export:** See source for details. - [register-schemas](./src/register-schemas.md) — Idempotent integration with `@suaveplan/schema-registry` for the `@suaveplan/bitpacker-streaming` package. Exposes `reg… - [default-clock](./src/defaults/default-clock.md) — _(no submodules)_- [otel](./src/otel/instruments.md) — _(no submodules)_ - [instruments](./src/otel/instruments.md) — _(no submodules)_- [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_ - [streaming-bit-packer](./src/streaming-bit-packer/streaming-bit-packer.md) — _(no submodules)_ - [streaming-bit-packer.schema](./src/streaming-bit-packer/streaming-bit-packer.schema.md) — Zod schemas for the option bundles consumed by `StreamingBitPacker` and its peer streaming helpers (`packStream`, `unpa… - [transform](./src/transform/transform.md) — _(no submodules)_ - [transform](./src/transform/transform.md) — _(no submodules)_ - [transform.schema](./src/transform/transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram… - [index](./src/index.md) — **Path:** `bitpacker-streaming/src/index.ts` **Export:** See source for details. - [register-schemas](./src/register-schemas.md) — Idempotent integration with `@suaveplan/schema-registry` for the `@suaveplan/bitpacker-streaming` package. Exposes `reg… ## Install ```bash bun add @suaveplan/bitpacker-streaming ``` ## Usage ```typescript import { BitPacker } from "@suaveplan/bitpacker"; import { registerDefaultStrategies } from "@suaveplan/bitpacker-strategies"; import { packToChunks, unpackFromChunks, createFramedPackStream, createFramedUnpackStream } from "@suaveplan/bitpacker-streaming"; const bp = new BitPacker(); registerDefaultStrategies(bp.strategyManager); const schema = 255; // Chunked packing const chunks = packToChunks(42, schema, { chunkSize: 2 }); const value = unpackFromChunks(chunks, schema); // Transform streams with framing const packStream = createFramedPackStream(bp, schema); const unpackStream = createFramedUnpackStream(bp, schema); packStream.readable.pipeTo(unpackStream.writable); const writer = packStream.writable.getWriter(); await writer.write(42); await writer.close(); const reader = unpackStream.readable.getReader(); const { value } = await reader.read(); // 42 ``` ## Modules - `src/index.ts` — `packToChunks`, `unpackFromChunks`, `unpackFromChunksAsync` - `src/transform/transform.ts` — `TransformStream` factories with length-prefix, delimiter, fixed-size, and no-framing options