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

    Class CsvStringify<T, O>

    CSV stringifier class for converting JavaScript objects into CSV format. Supports both synchronous and asynchronous streaming of CSV output.

    const data = [{ name: 'Alice', age: 30 }, { name: 'Bob', age: 25 }]
    const stringifier = new CsvStringify(data, { headers: ['name', 'age'] })
    const csvString = stringifier.toString()

    Type Parameters

    • T extends object = object

      The input object type

    • O extends object = T

      The output object type after optional transformation (defaults to T)

    Index

    Constructors

    • Creates a new CSV stringifier.

      Type Parameters

      • T extends object = object

        The input object type

      • O extends object = T

        The output object type after optional transformation (defaults to T)

      Parameters

      • values: Iterable<T, any, any> | AsyncIterable<T, any, any>

        Iterable or async iterable of objects to stringify

      • Optionaloptions: CsvStringifyOptions<T, O>

        Optional configuration for CSV stringification

      Returns CsvStringify<T, O>

    Properties

    alwaysWriteHeaders: boolean
    delimiter: string
    escapeChar: string
    headers?: string[]
    newline: string
    quoteChar: string
    transform?: (row: T) => O
    writeBom: boolean

    Methods