blazecsv
v1.0.2
Published
A lightweight csv reader for nodejs.
Downloads
1
Maintainers
Readme
node-csv
A lightweight csv reader for nodejs.
Usage
The utilities are exposed via the "CSV" class. Please refer to the directions below for help getting started.
- Install the library either by cloning this repo or with npm
npm install csvjs
- Create a new file script.js with the following contents
// import library
const {CSV} = require("csvjs")
// reading a file
let csv = new CSV("<path-to-csv-file>")
//get rows
let rows = csv.read()
//get object list
let objects = csv.read(true)
//append an object to the csv file
csv.append({...yourObject})
//write object list to file
csv.write(objectList:{}[])
//write object list to a different file
csv.write(objectList:{}[],"<new-file-name>")