Parse CSV string to records.
Optional
Readable stream of records
import { parseString } from 'web-csv-toolbox';const csv = `name,ageAlice,42Bob,69`;await parseString.toStream(csv) .pipeTo( new WritableStream({ write(record) { console.log(record); }, }), );// Prints:// { name: 'Alice', age: '42' }// { name: 'Bob', age: '69' } Copy
import { parseString } from 'web-csv-toolbox';const csv = `name,ageAlice,42Bob,69`;await parseString.toStream(csv) .pipeTo( new WritableStream({ write(record) { console.log(record); }, }), );// Prints:// { name: 'Alice', age: '42' }// { name: 'Bob', age: '69' }
Parse CSV string to records.