
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
csv-to-array
Advanced tools
A small NPM library for converting CSV files to JSON arrays.
Having a file named input.csv that contains:
11;12;13
21;22;23
31;32;33
41;42;43
you can convert it into array using:
// require the library
var CsvToArray = require ("csv-to-array");
// and use it
CsvToArray ({
csvOptions: {
delimiter: ";"
}
, file: __dirname + "/input.csv"
, columns: [
"Head 1"
, "Head 2"
, "Head 3"
]
}, function (err, response) {
console.log(err || JSON.stringify(response, null, 4));
});
You can test it using npm test:
$ npm test
> csv-to-array@0.0.1 test /home/.../csv-to-json
> node test/run.js
[
{
"Head 1": "11",
"Head 2": "12",
"Head 3": "13"
},
{
"Head 1": "21",
"Head 2": "22",
"Head 3": "23"
},
{
"Head 1": "31",
"Head 2": "32",
"Head 3": "33"
},
{
"Head 1": "41",
"Head 2": "42",
"Head 3": "43"
}
]
CsvToArray(@options, @callback)@options: object containing the following fields:
csvOptions: the options that will be passed to the a-csv modulefile: the CSV file pathcollumns: an array of strings@callback: the callback function (first argument will be err, the second one will be an array representing the converted CSV)
v0.1.0See LICENSE file.
FAQs
A library for converting CSV files to JSON arrays.
The npm package csv-to-array receives a total of 156 weekly downloads. As such, csv-to-array popularity was classified as not popular.
We found that csv-to-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.