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 strings into a stream of CSV records. Wraps a StringCSVParser instance to provide streaming CSV parsing.
Param: parser
StringCSVParser instance to use for parsing (required). Use createStringCSVParser to create one.
Param: options
Stream-specific options (backpressureCheckInterval, etc.)
Param: writableStrategy
Strategy for the writable side (default:
{ highWaterMark: 65536, size: chunk => chunk.length })Param: readableStrategy
Strategy for the readable side (default:
{ highWaterMark: 256 })Remarks
Recommended: Use the factory function
For simpler usage, use createStringCSVParserStream 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:
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.Example: Recommended: Using factory function
Example: Direct instantiation with parser
Example: With custom queuing strategies