~onelastjedi/json2csv

Parse JSON to CSV and vice versa in its simplest form.
Bump version
Update README.md
Merge pull request #7 from onelastjedi/add-code-of-conduct-1

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~onelastjedi/json2csv
read/write
git@git.sr.ht:~onelastjedi/json2csv

You can also use your local clone with git send-email.

bundle size version downloads

#json2csv

JavaScript library to convert JSON to CSV and back. Has no dependencies. Only works with flat objects.

#Installation

If you use npm, npm install @onelastjedi/json2csv. You can also download the latest release on GitHub.

#Use

import parse from '@onelastjedi/json2csv'

const csv = 'name,developer,age\nMary,true,25'
const json = { name: 'John', developer: false, age: 30 }

parse.csv2json(csv) // [{ name: 'Mary', developer: true, age: 25}]
parse.json2csv(json) // name,developer,age\nJohn,false,30

#License

ISC