csv-to-file
v1.0.3
Published
A simple command-line tool that converts a CSV file to your specified file for easy data manipulation and integration in your projects.
Downloads
1
Maintainers
Readme
csv-to-file
A simple command-line tool that converts a CSV file to your specified file for easy data manipulation and integration in your projects.
NOTE: This tool is designed to be used for internal purposes. It accepts and returns a specific format only.
Input
A CSV file with the following format:
- COLUMN 1: Variable Name
- COLUMN 2: English translation
- COLUMN 3: Bahasa translation
Output
export const <variable_name> = {
eng: <english_text>,
bhs: <bahasa_text>
};
In the converted file the variable name will be in uppercase and all the whitespaces will be replaced with underscores(_). Please refer to the below example:
Example
export const NEWEST_TO_OLDEST = {
eng: "Newest to Oldest",
bhs: "Terbaru ke Terlama"
}
Installation
To use this tool, you need to have Node.js installed on your system. If you don't have it, download and install it from nodejs.org.
You can install this CLI tool globally using npm:
npm install -g csv-to-file
Usage
Run the tool with the following command
csv-to-file --input input.csv --output output.js
NOTE: Please choose output file name carefully to get expected results. Recommended extensions - .txt, .js
Options
- --input or -i: The path to the input CSV file.
- --output or -o: The path for the output JavaScript file.
Example
csv-to-file --input data.csv --output data.js
This will convert the data.csv file to data.js file.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions
If you'd like to contribute to this project, please open an issue or submit a pull request. We welcome your suggestions and improvements.
Reporting Issue
If you encounter any issues or have questions, please open a GitHub issue.
Author
Sumit Kumar
Acknowledgments
Special thanks to the open-source community and libraries used in this project.