Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Working on React Components

Chaitanya Kumar Reddy chaituckr

💻
Working on React Components
  • Bangalore
View GitHub Profile
@chaituckr
chaituckr / arrayToCsv.js
Created Sep 8, 2020 — forked from sators/arrayToCsv.js
Convert Array of Objects to CSV with Javascript
View arrayToCsv.js
/**
* Take an array of objects of similar structure and convert it to a CSV.
* @source https://halistechnology.com/2015/05/28/use-javascript-to-export-your-data-as-csv/
* @modifiedBy sators
* @param {Array} options.data Array of data
* @param {String} options.columnDelimiter Column separator, defaults to ","
* @param {String} options.lineDelimiter Line break, defaults to "\n"
* @return {String} CSV
*/
export default ({data = null, columnDelimiter = ",", lineDelimiter = "\n"}) => {
You can’t perform that action at this time.