web-csv-toolbox
    Preparing search index...

    Class LexerTransformer<Delimiter, Quotation>

    A transform stream that converts a stream of tokens into a stream of rows.

    new ReadableStream({
    start(controller) {
    controller.enqueue("name,age\r\n");
    controller.enqueue("Alice,20\r\n");
    controller.close();
    }
    })
    .pipeThrough(new LexerTransformer())
    .pipeTo(new WritableStream({ write(tokens) {
    for (const token of tokens) {
    console.log(token);
    }
    }}));
    // { type: Field, value: "name", location: {...} }
    // { type: FieldDelimiter, value: ",", location: {...} }
    // { type: Field, value: "age", location: {...} }
    // { type: RecordDelimiter, value: "\r\n", location: {...} }
    // { type: Field, value: "Alice", location: {...} }
    // { type: FieldDelimiter, value: ",", location: {...} }
    // { type: Field, value: "20" }
    // { type: RecordDelimiter, value: "\r\n", location: {...} }

    Type Parameters

    • Delimiter extends string = DEFAULT_DELIMITER
    • Quotation extends string = DEFAULT_QUOTATION

    Hierarchy

    Index

    Constructors

    Properties

    Constructors

    Properties

    lexer: Lexer<Delimiter, Quotation>
    readable: ReadableStream<Token[]>
    writable: WritableStream<string>