OptionalcolumnOptionaldelimiterCSV field delimiter.
If you want to parse TSV, specify '\t'.
OptionalheaderOptionalincludeOptionalmaxMaximum internal buffer size in characters.
This option limits the size of the internal buffer used during lexing
to prevent memory exhaustion attacks. The buffer size is measured in
UTF-16 code units (JavaScript string length). When the buffer exceeds
this limit, a RangeError will be thrown.
Set to Infinity to disable the limit (not recommended for untrusted input).
OptionalmaxOptionaloutputOptionalquotationCSV field quotation.
OptionalsignalThe signal to abort the operation.
const controller = new AbortController();
const csv = "foo,bar\n1,2\n3,4";
try {
const result = await parse(csv, { signal: controller.signal });
} catch (e) {
if (e instanceof DOMException && e.name === "AbortError") {
console.log("Aborted");
}
}
// Abort with user action
document.getElementById("cancel-button")
.addEventListener("click", () => {
controller.abort();
});
OptionalskipOptionalsourceSource identifier for error reporting (e.g., filename, description).
This option allows you to specify a human-readable identifier for the CSV source that will be included in error messages. This is particularly useful when parsing multiple files or streams to help identify which source caused an error.
Security Note: Do not include sensitive information (API keys, tokens, full URLs) in this field as it may be exposed in error messages and logs.
CSV processing specification options.
Remarks
Defines how CSV data should be processed, including parsing behavior, output format, and data handling strategies. This excludes execution strategy (worker, WASM, etc.) which is defined separately in EngineOptions.
This type is used by low-level Parser classes that focus on CSV processing logic without concerning themselves with execution strategy. High-level APIs combine this with EngineOptions via ParseOptions.
Included settings:
Excluded settings:
Example: Low-level API usage
Example: High-level API (via ParseOptions)