first commit
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
|
||||
<!-- begin:auto-docs -->
|
||||
_(no submodules)_
|
||||
<!-- end:auto-docs --> - transform.schema — Zod schemas for the option bundl…
|
||||
- [transform.schema](./transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram…
|
||||
- transform.schema — Zod schemas for the option bundl…
|
||||
|
||||
- [transform.schema](./transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram…
|
||||
|
||||
- transform.schema — Zod schemas for the option bundl…
|
||||
|
||||
- [transform.schema](./transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram…
|
||||
|
||||
- transform.schema — Zod schemas for the option bundl…
|
||||
|
||||
- [transform.schema](./transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram…
|
||||
- [transform.schema](./transform.schema.md) — Zod schemas for the option bundles consumed by `createPackTransformStream`, `createUnpackTransformStream`, and the fram…
|
||||
|
||||
## Transform Streams
|
||||
|
||||
**Path:** `src/transform/transform.ts`
|
||||
**Export:** `createPackTransformStream`, `createUnpackTransformStream`, `createFramedPackStream`, `createFramedUnpackStream`, `parseFrames`, `addFrame`
|
||||
|
||||
### What it does
|
||||
|
||||
True `TransformStream` support for BitPacker with backpressure, batching, progress callbacks, and multiple framing strategies.
|
||||
|
||||
### Key API
|
||||
|
||||
| Function | Description |
|
||||
|----------|-------------|
|
||||
| `createPackTransformStream(bp, schema, options?)` | Transform objects → `Uint8Array` chunks |
|
||||
| `createUnpackTransformStream(bp, schema, options?)` | Transform `Uint8Array` → objects (length-prefix framing) |
|
||||
| `createFramedPackStream(bp, schema, framing?, options?)` | Pack with explicit framing config |
|
||||
| `createFramedUnpackStream(bp, schema, framing?, options?)` | Unpack with explicit framing config |
|
||||
| `parseFrames(buffer, framing)` | Extract complete frames from a buffer |
|
||||
| `addFrame(data, framing)` | Add framing to a message |
|
||||
|
||||
### Framing Types
|
||||
|
||||
- `length-prefix` — prefix with 1/2/4 byte length (default)
|
||||
- `delimiter` — suffix with delimiter bytes
|
||||
- `fixed-size` — pad/truncate to fixed size
|
||||
- `none` — no framing (single message per chunk)
|
||||
|
||||
### Depends on
|
||||
|
||||
- `BitPacker` from `@suaveplan/bitpacker`
|
||||
|
||||
### Used by
|
||||
|
||||
- Network streaming pipelines
|
||||
- File serialization with chunked I/O
|
||||
Reference in New Issue
Block a user