json-to-env-ks v1.0.2
json-to-env-ks (By Krushang)
š Easily Convert JSON Files to .env Format!
ā If this tool helps you, consider giving it a star on GitHub!
Read Docs
š Introduction
json-to-env-ks
is a simple yet powerful CLI tool that automatically converts JSON files to .env format. It eliminates the need for manual conversion, saving developers time and effort. Simply run a command, and your .env
file will be generated instantly!
Why use json-to-env-ks
?
- š Fast & Efficient ā Converts JSON to
.env
instantly. - š No Manual Work ā Avoid human errors in converting configurations.
- š Works with Any Project ā Supports Node.js, React.js, Next.js, Express.js, and more.
- š Lightweight & Easy to Use ā No complicated setup required.
š„ Installation
!IMPORTANT > It's crucial to install it globally so that you can use it from any directory in your terminal
Install globally:
npm install -g json-to-env-ks
Use without installation (via npx
):
npx json-to-env-ks "<json-file-path>" "<output-env-file-path>"
š How to Use
Basic Usage:
json-to-env-ks "<json-file-path>" "<output-env-file-path>"
Arguments:
- First argument ā Path to the JSON file you want to convert.
- Second argument ā Path where you want to save the
.env
file.
!TIP Wrap file paths in
"quotes"
to handle folders with spaces.
š Example Usage
Input (config.json
):
{
"DB_HOST": "localhost",
"DB_USER": "root",
"DB_PASS": "password"
}
Command:
json-to-env-ks "config.json" ".env"
Output (.env
):
DB_HOST=localhost
DB_USER=root
DB_PASS=password
š Features
āļø Converts JSON to .env
quickly
āļø Handles nested JSON structures gracefully
āļø Supports various frameworks like Node.js, React.js, Next.js, Express.js
āļø Lightweight and dependency-efficient
āļø Easy to install and use
āļø Automatically detects and preserves existing .env
file structure
āļø User-friendly CLI interface
ā Supported Platforms
- Node.js (Tested)
- React.js (Tested)
- Next.js (Tested)
- Express.js (Tested)
- Any Project using
.env
files
ā Not yet supported:
- YAML to
.env
conversion - Direct
.env
encryption
ā ļø Troubleshooting
1. Command Not Found?
If you installed it globally but get a "command not found" error, try:
npx json-to-env-ks "config.json" ".env"
Or, ensure your global npm binaries are in your system path:
echo $PATH
2. Permission Issues?
Try running the command with administrator privileges:
sudo npm install -g json-to-env-ks
3. Unexpected Output?
Ensure your JSON file is correctly formatted.
ā Contribute & Support
- If you found this package helpful, please ā star the GitHub repository!
- Issues and feature requests are welcome!
- Follow me on GitHub: Krushang-07
š Happy Coding! š