Skip to content

mfaheemakhtar/csvtojsonfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csvtojsonfile

A simple Node.js module to convert CSV file to JSON file.

How to use:

Install:

npm install csvtojsonfile --save

TIP: You can exclude "--save" if you are using npm 5.

Include:

const csvtojson = require('csvtojsonfile');

OR

import csvtojson from 'csvtojsonfile';

Examples:

// files are in the same directory
csvtojson('read.csv', 'write.json', err => {
  if (err) console.error(err);
  else console.log('DONE');
});
// files are in another directory
csvtojson('./dir/read.csv', './dir/write.json', err => {
  if (err) console.error(err);
  else console.log('DONE');
});

NOTE: All parameters are necessary.

Features:

  • Simple to use.
  • No dependencies. Only uses the core node modules.
  • Light-weight -- Just 55 lines of code including comments and blank lines.
  • Amazingly fast -- uses Asynchronous file read and write API.

Limitations:

  • Does not check for file type.
  • Uses JSON.stringify, which is Synchronous.

Support:

If you find errors or bugs, kindly open a issue on GitHub

Pull requests are also welcome.

About

A simple Node.js module to convert CSV file to JSON file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published