@maismel/csv-to-json-parser
v1.2.1
Published
csv to json parser
Readme
Csv to json parser
Short Description
A command line tool which allows the user to convert CSV files to JSON.
An npm package for parsing CSV files to JSON by implementing a custom NODE.js transform stream with the following abilities:
- Set or automatically detect the separator that is used for parsing (use "auto-detect" by default if no separator provided)
- Upload result JSON file to Google Drive disk
- Provide errors handling for converting process and incorrect command line arguments.
This application accepts following command line arguments using process.argv:
"sourceFile" - path to the csv file that need to be converted.
"resultFile" - path to the result json file.
"separator" - separator that is used while converting.
"json-to-csv" - converts a JSON file to CSV. If this option is not provided, the application converts CSV to JSON by default.
An example of running the app with command line arguments:
- node index.js --sourceFile "source.csv" --resultFile "result.json" --separator ","
- node index.js --sourceFile "source.csv" --resultFile "result.json" --separator " "
- node index.js --sourceFile "source.csv" --resultFile "result.json"
- node index.js --json-to-csv --sourceFile "source.json" resultFile "result.csv"