UNPKG

csv-string

Version:

PARSE and STRINGIFY for CSV strings. It's like JSON object but for CSV. It can also work row by row. And, if can parse strings, it can be use to parse files or streams too.

17 lines (16 loc) 683 B
export declare type LineBreak = '\r\n' | '\n' | '\r'; export declare type Comma = ',' | ';' | '|' | '\t'; export declare type Quote = '"' | string; export declare type Residue = ' ' | '\t' | '\f' | string; export declare type Value = string; export declare type PristineInput = string | number | null | undefined | { [key: string]: PristineInput; } | PristineInput[]; export declare type ReadCallback = (row: Value[]) => void; export declare type ReadAllCallback = (rows: Value[][]) => void; export declare type ForEachCallback = (row: Value[], index: number) => void; export declare type ParseOptions = { comma: Comma; quote: Quote; output: 'objects' | 'tuples'; };