File to parse
Optionaloptions: ParseBinaryOptions<Header, ",", "\"">Stream of records
import { parseFile } from 'web-csv-toolbox';
const input = document.querySelector('input[type="file"]');
input.addEventListener('change', async (event) => {
const file = event.target.files[0];
await parseFile.toStream(file)
.pipeTo(
new WritableStream({
write(record) {
console.log(record);
},
}),
);
});
Parse CSV from a File to stream of records.