Function parseUint8ArrayStream

  • Parse CSV to records. This function is for parsing a binary stream.

    Type Parameters

    • Header extends readonly string[]

    Parameters

    Returns AsyncIterableIterator<CSVRecord<Header>>

    Async iterable iterator of records.

    If you want array of records, use parseUint8ArrayStream.toArray function.

    Remarks

    If you want to parse a string, use parseStringStream.

    Example: Parsing CSV binary

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

    const csv = Uint8Array.from([
    // ...
    ]);

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

    for await (const record of parseUint8ArrayStream(csv)) {
    console.log(record);
    }