• Parse CSV string stream to records.

    Type Parameters

    • Header extends readonly string[]

    Parameters

    Returns ReadableStream<CSVRecord<Header>>

    Array of records

    Example

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

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

    const stream = new ReadableStream({
    start(controller) {
    controller.enqueue(csv);
    controller.close();
    },
    });

    await parseStringStream.toStream(stream)
    .pipeTo(
    new WritableStream({
    write(record) {
    console.log(record);
    },
    }),
    );