ts-csv

Simple CSV parser in TypeScript

View on GitHub

Home > @gregoranders/csv > Parser

Parser class

csv parser

Signature:

export declare class Parser<T = Record<string, string>> 

Example

import Parser from '@gregoranders/csv';

const parser = new Parser();
const rows = parser.parse('a,b,c\n1,2,3\n4,5,6');

Constructors

Constructor Modifiers Description
(constructor)(configuration)   constructor

Properties

Property Modifiers Type Description
json readonly readonly T[] returns rows as JSON using the first row as property name provider
rows readonly readonly Row[] returns rows

Methods

Method Modifiers Description
parse(text)   parse csv