This package has been deprecated

Author message:

this package has been deprecated

csv-to-collection

0.0.1 • Public • Published

csv-to-collection

A Node.js package that reads a csv file and returns a collection of objects, using the first record's values as field labels.

For example:

// this csv:
//
// name,age
// sally,5
// billy,10

// becomes...
[
	{name: "sally", age: "5"},
	{name: "billy", age: "10"}
]

Usage

var csv = require('csv-to-collection');

csv.readCsv(__dirname + "/test.csv", function (err, data) {
	if (err) throw err;
	console.log(data);
});

Special Notes

Some of the header row values are altered and cleaned up before they are used as labels:

  • new line characters are removed
  • multiple spaces are replaced with 1 space
  • all characters are converted to lower case

There are currently no options for this module. I'll add them when I need them, or as requested. Right now the module assumes UTF8 encoded, comma delimited, quote escaped csv files.

Installation

npm install csv-to-collection

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i csv-to-collection

Weekly Downloads

9

Version

0.0.1

License

none

Last publish

Collaborators

  • npm