OptionalarrayBlob reading strategy threshold (in bytes).
Only applicable for parseBlob() and parseFile().
Determines when to use blob.arrayBuffer() vs blob.stream():
blob.arrayBuffer() + parseBinary()
blob.stream() + parseBinaryStream()
Optional ExperimentalbackpressureBackpressure monitoring intervals (count-based: number of tokens/records processed).
OptionalonCallback when engine configuration fallback occurs.
Called when the requested configuration fails and falls back to a safer configuration.
Not called if strict: true (throws error instead).
Common fallback scenario:
workerStrategy: "stream-transfer" → "message-streaming" (Safari)Optional ExperimentalqueuingInternal streaming queuing strategies.
OptionalstrictStrict mode: disable automatic fallback.
When enabled:
onFallback is never calledWhen disabled (default):
onFallback if providedOptionalwasmUse WASM implementation.
WASM module is automatically initialized on first use. However, it is recommended to call loadWASM beforehand for better performance.
Execute in Worker thread.
OptionalworkerWorker pool for managing worker lifecycle.
When provided, the parsing function will use this pool's worker instance instead of creating/reusing a module-level singleton worker.
Use WorkerPool with the using syntax for automatic cleanup.
import { ReusableWorkerPool, parseString } from 'web-csv-toolbox';
async function processCSV(csv: string) {
using pool = new ReusableWorkerPool();
const records = [];
for await (const record of parseString(csv, {
engine: { worker: true, workerPool: pool }
})) {
records.push(record);
}
return records;
// Worker is automatically terminated when leaving this scope
}
import { ReusableWorkerPool, parseString } from 'web-csv-toolbox';
using pool = new ReusableWorkerPool();
await parseString(csv1, { engine: { worker: true, workerPool: pool } });
await parseString(csv2, { engine: { worker: true, workerPool: pool } });
// Worker is reused for both operations
OptionalworkerWorker communication strategy.
"message-streaming" (default): Message-based streaming
"stream-transfer": TransferableStreams
OptionalworkerCustom Worker URL.
If not provided, uses the bundled worker.
Engine configuration for worker thread execution.