1.0.2 • Published 6 months ago

json-to-env-ks v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

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:

  1. First argument – Path to the JSON file you want to convert.
  2. 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! 😃

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago