Skip to content

Instantly share code, notes, and snippets.

@manjeshpv
Created June 30, 2017 08:09
Show Gist options
  • Save manjeshpv/4913c566916ed268089d3d9c51d82b49 to your computer and use it in GitHub Desktop.
Save manjeshpv/4913c566916ed268089d3d9c51d82b49 to your computer and use it in GitHub Desktop.
const json2csv = (list, headers) => [headers]
.concat(list)
.map(row => Object
.values(row)
.join(','))
.join('\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment