OptionalheaderCSV header.
OptionalmaxMaximum number of fields allowed per record.
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();
});
OptionalskipWhen true, completely empty lines (with only delimiters or whitespace) will be skipped during parsing.
CSV Record Assembler Options.
Remarks
If you specify
header: ['foo', 'bar'], the first record will be treated as a normal record.If you don't specify
header, the first record will be treated as a header.