Interface AsyncJsonToCsvOptions

interface AsyncJsonToCsvOptions {
    delimiter?: string;
    includeHeaders?: boolean;
    renameMap?: Record<string, string>;
    template?: Record<string, any>;
    maxRecords?: number;
    preventCsvInjection?: boolean;
    rfc4180Compliant?: boolean;
    normalizeQuotes?: boolean;
    schema?: Record<string, any>;
    flatten?: boolean;
    flattenSeparator?: string;
    flattenMaxDepth?: number;
    arrayHandling?: "join" | "stringify" | "expand";
    memoryWarningThreshold?: number;
    memoryLimit?: number;
    useWorkers?: boolean;
    workerCount?: number;
    chunkSize?: number;
    onProgress?: (
        progress: { processed: number; total: number; percentage: number },
    ) => void;
}

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)

schema?: Record<string, any>

JSON schema for data validation and formatting

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.

useWorkers?: boolean

Use worker threads for processing (default: auto-detect based on data size)

workerCount?: number

Number of worker threads to use (default: CPU cores - 1)

chunkSize?: number

Size of data chunks for parallel processing

onProgress?: (
    progress: { processed: number; total: number; percentage: number },
) => void

Progress callback function