
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
convert-csv2json
Advanced tools
JS Library that allows to convert csv data into JSON objects, it takes care the input data as file or csv parsed to String
The Library takes care the input data as file or csv parsed to String
npm install convert-csv2json or yarn add convert-csv2json
import parser from "convert-csv2json";
const csvString = "name;age;email;phone\nMoahmed;20;mohamed@gmail.com;0564433289\nAli;28;ali@gmail.com;0564893289\nAhmed;34;ahmed@gmail.com;0590433289";
/*** convert the csv string into json ***/
const csvTojson = parser.csv2json(csvString, ";"); //the function csv2json needs two input parameters csv in String format and the delimiter symbol
console.info(csvTojson);
// prints :
// [
// {
// "name": "Mohamed",
// "age": 20,
// "email": "mohamed@gmail.com",
// "phone": "0564433289"
// },
// {
// "name": "Ali",
// "age": 28,
// "email": "ali@gmail.com",
// "phone": "0564893289"
// },
// {
// "name": "Ahmed",
// "age": 34,
// "email": "ahmed@gmail.com",
// "phone": "0590433289"
// }
// ]
Convert CSV data file into JSON
You have to pass the target event files[0] as parameter within the delimiter symbol once the csv file has been uploaded through chosen file
import parser from "convert-csv2json";
//use .then() implicitly to return a promise
parser.csvFile2json(e.target.files[0], ";").then((result) => {
console.log(result);
}error => {
console.error(error);
});
Important! In case of invalid csv file it will throw an error of csv file exception.
const parser = require('convert-csv2json');
If you have any contribution request, feature or if you found a bug or any issue please report them to this github repository
FAQs
JS Library that allows to convert csv data into JSON objects, it takes care the input data as file or csv parsed to String
The npm package convert-csv2json receives a total of 3 weekly downloads. As such, convert-csv2json popularity was classified as not popular.
We found that convert-csv2json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.