CSV string to parse
Optional
options: ParseBinaryOptions<Header>Parsing options.
Async iterable iterator of records.
If you want array of records, use parseUint8ArrayStream.toArray function.
If you want to parse a string, use parseStringStream.
import { parseUint8ArrayStream } from 'web-csv-toolbox';
const csv = Uint8Array.from([
// ...
]);
const stream = new ReadableStream({
start(controller) {
controller.enqueue(csv);
controller.close();
},
});
for await (const record of parseUint8ArrayStream(csv)) {
console.log(record);
}
Parse CSV to records. This function is for parsing a binary stream.