1.0.3 • Published 8 years ago

tccsvparser v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

CSV Parser

Simple csv parser. First line should contain the keys for each object generated, so that:

firstname,lastname
carlos,torija
max,bravo

becomes:

[{
	'firstname': 'carlos',
	'lastname': 'torija'
},{
	'firstname': 'max',
	'lastname': 'bravo'
}]

There are two versions, sync and async.

Async

parseCSV (path[, separator], callback)

The callback will receive

(err, json, nomatch)

err will be returned if the reading of the file fails

json will contain all the information that was build through the parser

nomatch will contain any line that has a different length than the title length

Sync

parseCSVSync (path[, separator])

This version will only return all the information that was build through the file

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago