csv-manager
v1.1.0
Published
Convert JSON to CSV
Downloads
14
Maintainers
Readme
CSV Manager
Usage
Import the package
const csv_manager = require('csv-manager');
JSON to CSV converter
Convert your json variable into a csv file.
csv_manager.toCSV(jsonArray,separator,path);
And your csv file will be saved in the path you wrote!
Example
Having the json array
var people=[
{name: 'Bruce', surname: 'Wayne'},
{name: 'Clark', surname:'Kent'},
{name: 'Peter', surname: 'Parker'}
]
Use the function toCSV() to get your CSV file, using the separator you want, in this example we are using comma (,)
csv_manager.toCSV(people, ',' ,'people.csv');
And your CSV file will be ready!