#csv-into-json
A Synchronous CSV to JSON convertor package.
const {csvPath} = require('csv-into-json')
let data = csvPath('./filename.csv')
let jsonData = JSON.stringify(data)
console.log(jsonData)
Or use it with express to send JSON response (Content-Type : application/json) as follows -

##Installation
$ npm install csv-into-json
##Usage
- Parse your CSV-file data into JSON in two steps:
- Provide relative path to your CSV file inside: csvPath(" ./yourfilepath ") and store it inside a variable.
- Convert the data stored inside that variable into JSON using JSON.stringify() function.
e.g :
Name,Age,Address in
Andy,21,Down town
Barbara,25,"Old street, 36"
Carl,24,Kings cross
[
{
"name": "Andy",
"age": "21",
"address-in": "Down town"
},
{
"name": "Barbara",
"age": "25",
"address-in": "Old street, 36"
},
{
"name": "Carl",
"age": "24",
"address-in": "Kings cross"
}
]