Convert CSV string to JSON object
Convert JSON object to CSV string
CSV string: "path1, path2, path3, string"
// From
'popup, title, Login'
// To
{
popup: {
title: 'Login'
}
}
npm install csv-property
const { toObject, toCSVString } = require('csv-property')
toObject([ 'popup, title, Login' ]) // { popup: { title: 'Login' } }
toCSVString({ popup: { title: 'Login' } }) // [ 'popup, title, Login' ]
toObject([ 'popup; title; Login' ], ';') // { popup: { title: 'Login' } }
toCSVString({ popup: { title: 'Login' } }, ';') // [ 'popup; title; Login' ]
MIT © Bob Hwang