1.0.0 • Published 4 years ago

convert-csv-json v1.0.0

Weekly downloads
14
License
ISC
Repository
github
Last release
4 years ago

convert-csv-json

Convert the content of a CSV file to a json and vice versa

Installation

npm i convert-csv-json

Example

const { csv2json, json2csv } = require('convert-csv-json');

// Read a CSV file
const fs = require('fs');
fs.readFile('myFile.CSV', (err, data) => {
    // Convert the content of CSV file to a json object
    const myJson = csv2json(data.toString());
    
    // Do some stuff with the json...

    // Convert the json to CSV again
    const myCSV = json2csv(myJson);
})