Crates.io | env2js |
lib.rs | env2js |
version | 1.0.1 |
source | src |
created_at | 2020-02-22 21:40:29.435724 |
updated_at | 2020-02-22 21:40:29.435724 |
description | A tool for creating js/json files with env vatiables |
homepage | https://github.com/SkeLLLa/env2js |
repository | https://github.com/SkeLLLa/env2js |
max_upload_size | |
id | 211575 |
size | 13,966 |
Converts current env to js/json. Supports reading from .env
files.
All commands are available via env2js --help
>$ env2js --help
Converts your env to js or json file
USAGE:
env-to-json [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --config <FILE> Sets a custom env file [default: .env]
-g, --global <GLOBAL_VAR> Sets a custom global variable for javascript [default: __env]
-p, --prefix <PREFIX> Env variables prefix filter
-t, --type <TYPE> Set output type [default: js] [possible values: js, json]
You can use it for making env variables available in runtime of your react app.
>$ REACT_APP_FOO=bar env2js -g env -p REACT_APP_ -t js > env.js
Will result in following file:
window.env = {"FOO":"bar"}