ReferencePackages
@mwillbanks/tuil-streaming
Extensible backpressure-aware streaming parsers, transformers, and projections for tuil.
Overview
Extensible backpressure-aware streaming parsers, transformers, and projections for tuil.
@mwillbanks/tuil-streaming is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-streamingHow it operates
Streaming pipelines incrementally decode and parse common text formats with cancellation, backpressure, transforms, projections, diagnostics, bounded source, and replay.
API
| API | Signature | Description |
|---|---|---|
BackpressureController | interface BackpressureController | Public interface BackpressureController. |
BoundedBackpressureController | class BoundedBackpressureController | Public class BoundedBackpressureController. |
builtInDocumentTransformers | constant builtInDocumentTransformers | Public constant builtInDocumentTransformers. |
builtInFormatParsers | constant builtInFormatParsers | Public constant builtInFormatParsers. |
builtInRenderProjections | constant builtInRenderProjections | Public constant builtInRenderProjections. |
DocumentNode | interface DocumentNode | Public interface DocumentNode. |
DocumentTransformer | interface DocumentTransformer | Public interface DocumentTransformer. |
FormatParser | interface FormatParser | Public interface FormatParser. |
FormatParserSession | interface FormatParserSession | Public interface FormatParserSession. |
ParserDiagnostic | interface ParserDiagnostic | Public interface ParserDiagnostic. |
PartialDocument | interface PartialDocument | Public interface PartialDocument. |
RenderProjection | interface RenderProjection | Public interface RenderProjection. |
SourceSpan | interface SourceSpan | Public interface SourceSpan. |
StreamDecoder | interface StreamDecoder | Public interface StreamDecoder. |
StreamEvent | type StreamEvent | Public type StreamEvent. |
StreamRenderer | interface StreamRenderer | Public interface StreamRenderer. |
Utf8StreamDecoder | class Utf8StreamDecoder | Public class Utf8StreamDecoder. |
Events and lifecycle
Typed start, document, diagnostic, and end events carry monotonically increasing sequence numbers.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
const pipeline = new StreamingPipeline({ format: "jsonl" });
await pipeline.write(chunk);