convert-csv-json

1.0.0 • Public • Published

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);
})
 

Readme

Keywords

Package Sidebar

Install

npm i convert-csv-json

Weekly Downloads

4

Version

1.0.0

License

ISC

Unpacked Size

1.85 kB

Total Files

5

Last publish

Collaborators

  • babak.gh