Interface JsonToCsvStreamOptions

interface JsonToCsvStreamOptions {
    delimiter?: string;
    includeHeaders?: boolean;
    renameMap?: Record<string, string>;
    template?: Record<string, any>;
    maxRecords?: number;
    preventCsvInjection?: boolean;
    rfc4180Compliant?: boolean;
    normalizeQuotes?: boolean;
    flatten?: boolean;
    flattenSeparator?: string;
    flattenMaxDepth?: number;
    arrayHandling?: "join" | "stringify" | "expand";
    memoryWarningThreshold?: number;
    memoryLimit?: number;
    transform?: (row: Record<string, any>) => Record<string, any>;
    schema?: Record<string, any>;
    addBOM?: boolean;
}

Hierarchy (View Summary)

Properties

delimiter?: string

CSV delimiter (default: ';')

includeHeaders?: boolean

Include headers row (default: true)

renameMap?: Record<string, string>

Rename column headers { oldKey: newKey }

template?: Record<string, any>

Template for guaranteed column order

maxRecords?: number

Maximum number of records to process (optional, no limit by default)

preventCsvInjection?: boolean

Prevent CSV injection attacks by escaping formulas (default: true)

rfc4180Compliant?: boolean

Ensure RFC 4180 compliance (proper quoting, line endings) (default: true)

normalizeQuotes?: boolean

Normalize excessive quotes in JSON string values before CSV export (default: true)

flatten?: boolean

Whether to flatten nested objects into dot notation keys

flattenSeparator?: string

Separator for flattened keys (e.g., 'user.name' with '.')

flattenMaxDepth?: number

Maximum depth for flattening nested objects

arrayHandling?: "join" | "stringify" | "expand"

How to handle arrays ('stringify', 'join', 'expand')

memoryWarningThreshold?: number

Warn when record count exceeds this threshold (default: 1000000)

memoryLimit?: number

Safety limit for in-memory conversion (default: 5000000). Set to Infinity to disable.

transform?: (row: Record<string, any>) => Record<string, any>

Custom transform function for each row

schema?: Record<string, any>

JSON schema for validation and formatting

addBOM?: boolean

Add UTF-8 BOM for Excel compatibility (default: true)