Convert a 2D array to CSV.
const toCSV = require('array-to-csv')
//Comma-seperated values
toCSV([
['header 1', 'header 2'],
['value 1', 'value 2']
])
//If you prefer using tab as delimiter
toCSV([
['header 1', 'header 2'],
['value 1', 'value 2']
], "\t")
//Join cells only
toCSV.joinCells(['value 1', 'value 2'])
//Escape one cell only
toCSV.escapeCell('value 1')
- rename joinRow() to joinCells()
- expose joinRow() and escapeCell() functions
- fix cell with newline is not quoted
- added alwaysQuote parameter
- Object with array as values also works now (key will be dropped)
- array with cell containing function works now
- array with number/boolean/null/undefined should work now
- fix double quote is not being escaped.
- fix mocha test case.
- accept other delimiter.