Skip to content

🏭 Parse JSON to CSV and vice versa in it's simplest form.

License

Notifications You must be signed in to change notification settings

onelastjedi/json2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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