tc

tiny-csv

Parse a CSV string into an array of objects.

Showing:

Popularity

Downloads/wk

4

GitHub Stars

4

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

tiny-csv

NPM version License Build status

Parse a CSV string into an array of objects.

Installation

npm install tiny-csv

Usage

var fs  = require('fs')
var csv = require('tiny-csv')

var csvData = fs.readFileSync('data.csv', 'utf8')
console.log(csv(csvData))
// [
//   { key: 'one', value: 'two' },
//   { key: 'three', value: 'four' },
//   { key: 'five', value: 'six' }
// ]

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

Caveats

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100