cparker15 / CSV-js

A CSV (comma-separated values) parser written in JavaScript.

Home Page:http://www.cparker15.com/code/utils/csv-to-json/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSV-js Build Status

A CSV (comma-separated values) parser written in JavaScript.

Originally part of Christopher Parker's CSV to JSON converter. Because of this, some feature requests, bug reports, etc. may be filed there, instead. Before opening a new issue here, please make sure it doesn't already exist there.

Building

Prerequisites:

After cloning this repo, here's how to build:

$ npm install
$ grunt

This will download all dependencies, lint, test, and minify the library.

The minified library resides at dist/csv.min.js.

Using

Basic example:

var CSV = require('csv-js'),
    input = 'foo, bar, baz\n1, 2, 3',
    output;

try {
    output = CSV.parse(input);
    console.dir(output);
} catch (e) {}

The output array will be inspected by console.dir and the following will be printed to stdout:

[
    {
        "foo": "1",
        "bar": "2",
        "baz": "3"
    }
]

About

A CSV (comma-separated values) parser written in JavaScript.

http://www.cparker15.com/code/utils/csv-to-json/

License:GNU Lesser General Public License v3.0


Languages

Language:JavaScript 100.0%