The type of the header row
Output format: 'object' or 'array'
ReadonlyparserReadonlyreadableThe 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 binary data (BufferSource) into a stream of CSV records. Wraps a BinaryCSVParser instance to provide streaming CSV parsing.
Param: parser
BinaryCSVParser instance to use for parsing (required). Use createBinaryCSVParser to create one.
Param: options
Stream-specific options (backpressureCheckInterval, etc.)
Param: writableStrategy
Strategy for the writable side (default:
ByteLengthQueuingStrategy({ highWaterMark: 65536 }))Param: readableStrategy
Strategy for the readable side (default:
CountQueuingStrategy({ highWaterMark: 256 }))Remarks
Recommended: Use the factory function
For simpler usage, use createBinaryCSVParserStream which handles parser creation internally:
Direct instantiation (advanced)
If you need direct access to the parser or want to reuse it, use the constructor directly:
Accepts any BufferSource type (Uint8Array, ArrayBuffer, or other TypedArray views) as input chunks.
Queuing Strategy:
ByteLengthQueuingStrategywith highWaterMark of 65536 bytes (64KB).CountQueuingStrategywith highWaterMark of 256 records.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.Example: Recommended: Using factory function
Example: Direct instantiation with parser
Example: With fetch API