The type of the header row.
ReadonlyassemblerReadonlyreadableThe readable read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream.
ReadonlywritableThe writable read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream.
A transform stream that converts a stream of tokens into a stream of CSV records.
Param: options
CSV-specific options (header, maxFieldCount, etc.)
Param: writableStrategy
Strategy for the writable side (default:
{ highWaterMark: 1024, size: () => 1, checkInterval: 10 })Param: readableStrategy
Strategy for the readable side (default:
{ highWaterMark: 256, size: () => 1, checkInterval: 10 })Remarks
Follows the Web Streams API pattern where queuing strategies are passed as constructor arguments, similar to the standard
TransformStream.Default Queuing Strategy:
Backpressure Handling: The transformer monitors
controller.desiredSizeand yields to the event loop when backpressure is detected (desiredSize ≤ 0). This prevents blocking the main thread during heavy processing and allows the downstream consumer to catch up.These defaults are starting points based on data flow characteristics, not empirical benchmarks. Optimal values depend on your runtime environment, data size, and performance requirements.
Example: Parse a CSV with headers by data
Example: Parse a CSV with headers by options
Example: Custom queuing strategies with backpressure tuning