npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

tiniest-csv

2.0.0 • Public • Published

tiniest-csv

NPM version License Build status

Parse a CSV string into a two-dimensional array.

Installation

npm install tiniest-csv

Usage

var fs = require('fs')
var csv = require('tiniest-csv')
 
var csvData = fs.readFileSync('data.csv', 'utf8')
console.log(csv(csvData))
// [
//   ['key', 'value'],
//   ['one', 'two'],
//   ['three', 'four'],
//   ['five', 'six']
// ]
 
var tsvData = fs.readFileSync('data.tsv', 'utf8')
console.log(csv(tsvData, /\t/))
// [
//   ['key', 'value'],
//   ['one', 'two'],
//   ['three', 'four'],
//   ['five', 'six']
// ]

Caveats

The module is meant to be used on smaller sets of data. If you need maximum speed, use csv-parser.

License

MIT

install

npm i tiniest-csv

Downloadsweekly downloads

3

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability