1.0.3 • Published 6 years ago

csv-export-util v1.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

###Utility to download csv file

How to use download csv file utility

$ npm install csv-export-util --save

const downloadCSV = require("csv-export-util")

/**
 * @param {object[]} headers
 * @param {object[]} data
 * @param {string} fileName
 */
downloadCSV(headers, data, fileName)

headers = [
  {
    key_name: "Header Name"
  }
]
data = [
  {
    key_name: "key_value"
  },
  {
    key_name: "key_value"
  }
]
fileName = "your_downloadable_file_name"

Explanation about params

headers used to define csv file column names and allows only one list object. Key names of each header value must match with the key names available in data.

data used to define csv file column values and allows multiple list object. Key names of each key value must match with the key names declared in headers.

fileName used to define the download csv file name.

1.0.2

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago