• Parse CSV string to records.

    Type Parameters

    • Header extends readonly string[]

    Parameters

    Returns ReadableStream<CSVRecord<Header>>

    Readable stream of records

    Example

    import { parseString } from 'web-csv-toolbox';

    const csv = `name,age
    Alice,42
    Bob,69`;

    await parseString.toStream(csv)
    .pipeTo(
    new WritableStream({
    write(record) {
    console.log(record);
    },
    }),
    );
    // Prints:
    // { name: 'Alice', age: '42' }
    // { name: 'Bob', age: '69' }