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

    Class CsvEntity<T, S>Abstract

    Abstract base class for CSV entities that supports both synchronous and asynchronous parsing. Provides common functionality for reading and streaming CSV data.

    Type Parameters

    • T

      The type returned by read operations

    • S = T

      The type yielded by stream operations (defaults to T)

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

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

    Accessors

    Methods

    • Makes this entity async iterable using the asynchronous stream.

      Returns AsyncGenerator<S>

      An async generator that yields values of type S

    • 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 and parses the entire entity asynchronously. Marks the entity as consumed after reading.

      Returns Promise<T>

      A promise that resolves to the parsed result of type T

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

      Returns Generator<S>

      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<S>

      An async generator that yields values of type S