lisa.csv.parser.js
v1.0.2
Published
csv to json and json to csv, and tiny lightly one
Downloads
4
Readme
csv.parser.js
csv to json and json to csv , what is a pity that i must repeatly make the wheel
just do it
npm i --save lisa.csv.parser.js
const p = require('lisa.csv.parser.js')
const json = [
{code: 'CA', name: 'California', hello : { name : '1'}},
{code: 'TX', name: 'Texas'},
{code: 'NY', name: 'New York'},
]
// delimiter default is ','
(async()=>{
var csv = await p.toCsv(json, {delimiter : '\t'})
console.log(csv)
var json2 = p.toJson(csv , {delimiter : '\t'})
console.log(JSON.stringify(json2))
})()