Skip to content

FocusoftHQ/json-to-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

json_to_env

json_to_env is a simple bash script utility to locally convert JSON files into .env format.

Requirements

  • jq: This script uses jq to parse and convert the JSON data.
  • Flat JSON Structure: The provided JSON file should have a flat structure. Nested JSON structures are not supported for conversion.

Usage

./json_to_env.sh <input_json_file> <output_env_file>
  • <input_json_file>: The path to your source JSON file.
  • <output_env_file>: The path where you want the resulting .env file to be saved.

Example:

./json_to_env.sh config.json config.env

Installation

  1. Clone this repository or download the json_to_env.sh file directly.
  2. Provide execute permissions to the script:
chmod +x json_to_env.sh
  1. Ensure jq is installed. If not, you can generally install it using package managers:

For Ubuntu/Debian:

sudo apt-get install jq

For macOS (using Homebrew):

brew install jq

For other distributions or platforms, please check the jq official documentation.

Contributing

Feel free to fork this repository, make changes, and submit pull requests. Any kind of contributions are welcome!

License

MIT

About

Simple bash script script to locally convert JSON files to .env format

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages