Options for CSV parsing and stringifying.

interface CSVOptions {
    delimiterChar?: string;
    disableNumberConverstion?: boolean;
    quoteChar?: string;
    replacer?: ((r: number, c: number, v: any) => any);
    reviver?: ((r: number, c: number, v: string) => any);
}

Properties

delimiterChar?: string

The character used to delimit columns in CSV data.

disableNumberConverstion?: boolean

Disables automatic conversion of numeric values during parsing.

quoteChar?: string

The character used for quoting fields in CSV data.

replacer?: ((r: number, c: number, v: any) => any)

A function that can act as a replacer for stringifying CSV values.

Type declaration

    • (r, c, v): any
    • Parameters

      • r: number

        The row index of the CSV value being stringified.

      • c: number

        The column index of the CSV value being stringified.

      • v: any

        The value to stringify.

      Returns any

      The stringified value.

reviver?: ((r: number, c: number, v: string) => any)

A function that can act as a reviver for parsed CSV values.

Type declaration

    • (r, c, v): any
    • Parameters

      • r: number

        The row index of the parsed CSV value.

      • c: number

        The column index of the parsed CSV value.

      • v: string

        The parsed value as a string.

      Returns any

      The transformed value.