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.

28 lines (27 loc) 704 B
import { Comma, Quote, Value } from './types'; export declare class Parser { input: string; quote: Quote; comma: Comma; pointer: number; linePointer: number; _residueRegExp: RegExp; _simpleValueRegExp: RegExp; _replaceQuoteRegExp: RegExp; constructor(input: string, comma?: Comma, quote?: Quote); File(output: "objects"): { [k: string]: Value; }[]; File(output?: "tuples"): Value[][]; File(output?: "tuples" | "objects"): { [k: string]: Value; }[] | Value[][]; Row(): Value[]; private Value; private Comma; private LineBreak; private SimpleValue; private QuotedValue; private EOF; private Residue; }