ReadonlylexerReadonlyreadableThe 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 strings into a stream of tokens.
Param: options
CSV-specific options (delimiter, quotation, etc.)
Param: writableStrategy
Strategy for the writable side (default:
{ highWaterMark: 65536, size: chunk => chunk.length, checkInterval: 100 })Param: readableStrategy
Strategy for the readable side (default:
{ highWaterMark: 1024, size: () => 1, checkInterval: 100 })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: Basic usage
Example: Custom queuing strategies with backpressure tuning