Skip to content

FbW47-1/fileio-csvConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

CSV Converter

Create a program that converts CSV files into JSON files, using the csvtojson library.

Constraints

  • The program should accept one or two arguments. If no arguments are passed, the program should exit the process and print a message to the user (see examples).

  • If only one argument is passed, the program should convert the file in that path to a json file in the same directory.

  • If two arguments are passed, the program should write the file to the path in the second argument.

  • If the program cannot read or write the file, it should print out a message to the user (see examples).

Examples

One argument passed (Source CSV)

$ node index.js demo.csv
> "JSON file saved at: demo.json"

Two arguments passed (Source CSV, target JSON)

$ node index.js demo.csv hello.json
> "JSON file saved at: hello.json"

No arguments passed

$ node index.js
> "Please provide a csv file to convet to JSON"

An error occured

$ node index.js dem.csv hello.json
> "Something went wrong, Could not write json to: hello.json"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published