Gathering detailed insights and metrics for convert-array-to-csv
Gathering detailed insights and metrics for convert-array-to-csv
Gathering detailed insights and metrics for convert-array-to-csv
Gathering detailed insights and metrics for convert-array-to-csv
csv-exportor
convert array to csv file, and allow browser to automatically download the file
jsonexport
Makes easy to convert JSON to CSV
@types/convert-array-to-csv
TypeScript definitions for convert-array-to-csv
json-csv
Easily convert JSON array to CSV in Node.JS via buffered or streaming.
npm install convert-array-to-csv
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
31 Stars
34 Commits
11 Forks
2 Watchers
12 Branches
4 Contributors
Updated on May 28, 2024
Latest Version
2.0.0
Package Id
convert-array-to-csv@2.0.0
Unpacked Size
15.96 kB
Size
5.52 kB
File Count
13
NPM Version
6.10.3
Node Version
10.16.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Convert an array to a csv formatted string
I needed a simple way to download the data from a table component in a csv format.
1$ npm i convert-array-to-csv -S
or
1$ yarn add convert-array-to-csv
Take a look into the usage section for a detailed example.
Note: you can also use the default export.
This function converts an array of objects, or an array of arrays into an csv formatted string.
Returns a new string.
1const csv = convertArrayToCSV(data, options);
undefined
','
An example how to use it.
1const { convertArrayToCSV } = require('convert-array-to-csv'); 2const converter = require('convert-array-to-csv'); 3 4const header = ['number', 'first', 'last', 'handle']; 5const dataArrays = [ 6 [1, 'Mark', 'Otto', '@mdo'], 7 [2, 'Jacob', 'Thornton', '@fat'], 8 [3, 'Larry', 'the Bird', '@twitter'], 9]; 10const dataObjects = [ 11 { 12 number: 1, 13 first: 'Mark', 14 last: 'Otto', 15 handle: '@mdo', 16 }, 17 { 18 number: 2, 19 first: 'Jacob', 20 last: 'Thornton', 21 handle: '@fat', 22 }, 23 { 24 number: 3, 25 first: 'Larry', 26 last: 'the Bird', 27 handle: '@twitter', 28 }, 29]; 30 31/* 32 const csvFromArrayOfObjects = 'number,first,last,handle\n1,Mark,Otto,@mdo\n2,Jacob,Thornton,@fat\n3,Larry,the Bird,@twitter\n'; 33*/ 34const csvFromArrayOfObjects = convertArrayToCSV(dataObjects); 35 36/* 37 const csvFromArrayOfArrays = 'number;first;last;handle\n1;Mark;Otto;@mdo\n2;Jacob;Thornton;@fat\n3;Larry;the Bird;@twitter\n'; 38*/ 39const csvFromArrayOfArrays = convertArrayToCSV(dataArrays, { 40 header, 41 separator: ';' 42});
MIT © Lukas Aichbauer
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/28 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
36 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More