web-csv-toolbox - v0.15.0
    Preparing search index...

    Class StringCSVLexerTransformer<_Delimiter, _Quotation>

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

    For most use cases, prefer the factory function createStringCSVLexerTransformer. Use this class directly only when you need a custom lexer implementation.

    A StringCSVLexer instance (required). Use createStringCSVLexer to create one.

    Stream-specific options (backpressureCheckInterval, etc.)

    Strategy for the writable side (default: { highWaterMark: 65536, size: chunk => chunk.length })

    Strategy for the readable side (default: { highWaterMark: 1024, size: () => 1 })

    Choosing the Right API for guidance on selecting the appropriate API level.

    import { StringCSVLexerTransformer, type StringCSVLexer, type Token } from 'web-csv-toolbox';

    // Custom lexer for non-standard CSV dialect
    class MyCustomLexer implements StringCSVLexer {
    lex(chunk?: string, options?: { stream?: boolean }): IterableIterator<Token> {
    // Return an iterator (can use internal generator)
    return this.#tokens();
    }
    *#tokens(): Generator<Token> {
    // Actual token generation logic
    }
    }

    const customLexer = new MyCustomLexer();
    stream.pipeThrough(new StringCSVLexerTransformer(customLexer));

    Type Parameters

    Hierarchy

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    The readable read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream.

    MDN Reference

    writable: WritableStream<string>

    The writable read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream.

    MDN Reference

    Methods