json-csv-transformer
transform json to csv, and vice versa
Install
npm install json-csv-transformer --save
Use
const CSV = require('json-csv-transformer')
const csv = new CSV({
schema: [{
key: 'xxx',
label: 'XXX',
type: 'string',
}]
})
// parse data, csv or json
csv.parse(data)
// get file dataURL
csv.getDataURL()
// transform to JSON
csv.toJSON()
find more use case, please see test