csv-stream-lite - v1.0.4
    Preparing search index...

    Class CsvCell

    Represents a single CSV cell that can be read as a string or streamed in chunks. Handles quoted cells and escape sequences according to CSV standards.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    byteBuffer: ByteBuffer
    chunkSize: number = DEFAULT_CHUNK_SIZE
    consumed: boolean = false
    endOfLineReached: boolean = false
    escapeChar: string = '"'
    newline?: string
    quoteChar: string = '"'
    separator: string = ','
    trim: boolean = false

    Accessors

    Methods

    • Asynchronously consumes the entity if it hasn't been consumed yet. This ensures the buffer advances to the end of this entity.

      Returns Promise<void>

      A promise that resolves when consumption is complete

    • Reads the cell value and transforms it using the provided function. Special handling for Boolean transformer: converts 'true'/'false' strings to boolean.

      Type Parameters

      • T

        The type to transform the cell value into

      Parameters

      • transform: (cell: string) => T

        Function to transform the cell string into type T

      Returns T

      The transformed value of type T

    • Asynchronously reads the cell value and transforms it using the provided function. Special handling for Boolean transformer: converts 'true'/'false' strings to boolean.

      Type Parameters

      • T

        The type to transform the cell value into

      Parameters

      • transform: (cell: string) => T | Promise<T>

        Function to transform the cell string into type T (can be async)

      Returns Promise<T>

      A promise that resolves to the transformed value of type T

    • Returns a synchronous generator that yields chunks of type S. Marks the entity as consumed when iteration completes.

      Returns Generator<string>

      A generator that yields values of type S

    • Returns an asynchronous generator that yields chunks of type S. Handles buffering and automatically reads more data as needed.

      Returns AsyncGenerator<string>

      An async generator that yields values of type S