rawiki-parse-csv

1.0.7 • Public • Published

Synopsis

This is a very lightweight module which parses a CSV file and creates either an object or set of arrays depending on the options specified. This module has no dependencies and is under the MIT license.

Disclaimer

This module will fail to correctly parse strings containing special characters so it is not recommended that you use this in production. An update will be available soon after thorough testing.

Usage

var parse = require('rawiki-parse-csv'); //require module
data = "s,a,m,p,l,e\nc,s,v\nd,a,t,a\n; //your csv data
var output = parse(data, true); //save parse output

Parse function takes one option, if true output will be an object and use the CSV data's first line as a column header. If blank or false output will be an array.

Testing

Mocha and Chai have been included as dev dependencies. Simply run npm test within the module's directory to confirm functionality.

Readme

Keywords

Package Sidebar

Install

npm i rawiki-parse-csv

Weekly Downloads

0

Version

1.0.7

License

MIT

Last publish

Collaborators

  • rawikitua