Optional
headerCSV header.
Optional
signalThe 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();
});
Record Assembler Options for CSV.
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.