• Preparing search index...
  • The search index is not available
web-csv-toolbox
  • web-csv-toolbox
  • parseUint8ArrayStream
  • toStream

Function toStream

  • toStream<Header>(stream, options?): ReadableStream<CSVRecord<Header>[]>
  • Parse CSV binary to array of records.

    Type Parameters

    • Header extends readonly string[]

    Parameters

    • stream: ReadableStream<Uint8Array>
    • Optional options: ParseBinaryOptions<Header>

    Returns ReadableStream<CSVRecord<Header>[]>

    Stream of records

    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();
    },
    });

    await parseUint8ArrayStream.toStream(stream)
    .pipeTo(new WritableStream({
    write(record) {
    console.log(record);
    },
    }),
    );
    • Defined in src/parseUint8ArrayStream.ts:108

Settings

Member Visibility

Theme

web-csv-toolbox
  • Loading...

Generated using TypeDoc