© ,Kailash Yogeshwar, Licensed under MIT-License
csv-2-json (Node.js)
Npm module to convert your CSV file to JSON file with custom options to specify file name and identation level to be use in Json file.
Install
npm install csv-2-json --save
Features
- Converts and saves your csv data into JSON format with custom options to specify file name and indentation to use in JSON file.
- Specify Custom delimiter options to parse csv data
Example Usage
var csvtojson = require('csv-2-json');
csvtojson.toJson('./sample.csv')
With Custom Options
Example
var csvtojson = require('csv-2-json');
var options = {
'filename':'report.json',
'indent': 4
}
csvtojson.toJson('./sample.csv',options);
Custom Delimiter
var csvjson = require('csv-2-json');
var options = {
filename: "result.json",
indent: 4,
delimiter: "\t"
}
csvjson.toJson('./sample.csv',options);