• Parse CSV Response to stream of records.

    Type Parameters

    • Header extends readonly string[]

    Parameters

    Returns ReadableStream<CSVRecord<Header>[]>

    Stream of records

    Example: Parsing CSV Response

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

    const response = await fetch('https://example.com/data.csv');

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