A command-line tool for converting between various data formats: CSV, JSON, XML, and YAML.
Ensure you have Node.js installed on your machine. Then, clone this repository and install dependencies using npm:
git clone <repository-url>
cd <repository-directory>
npm install./data-converter csvtojson <inputFile> <outputFile>- inputFile: Path to the CSV file you want to convert.
- outputFile: Path where the resulting JSON file should be saved.
Example:
./data-converter csvtojson input.csv output.json./data-converter xmltoyaml <inputFile> <outputFile>- inputFile: Path to the XML file you want to convert.
- outputFile: Path where the resulting YAML file should be saved.
Example:
./data-converter xmltoyaml input.xml output.yaml./data-converter jsontocsv <inputFile> <outputFile>- inputFile: Path to the JSON file you want to convert.
- outputFile: Path where the resulting CSV file should be saved.
Example:
./data-converter jsontocsv input.json output.csv./data-converter csvtojson data.csv result.json./data-converter xmltoyaml data.xml result.yaml./data-converter jsontocsv data.json result.csvcsvtojson: For converting CSV to JSON.xml2js: For converting XML to JavaScript objects (used for YAML conversion).js-yaml: For converting JavaScript objects to YAML.json2csv: For converting JSON to CSV.