This is a cli executable for dotenv-flow.
Either install it globally:
$ npm install -g dotenv-flow-cli
or add to your project:
Yarn
$ yarn add dotenv-flow-cli
NPM
$ npm install dotenv-flow-cli
$ dotenv-flow <command with arguments>
This will load the variables from the .env*
files in the current working directory and then run the command (using the new set of environment variables).
For more information about how the .env*
files are loaded, please refer to dotenv-flow docs.
You may specify a path where your .env*
files are located with the -p
option:
$ dotenv-flow -p path/to/project <command with arguments>
Put --
separator before the command if it takes additional arguments, otherwise they might get lost.
$ dotenv-flow -- my-command -p something
To allow it to be a drop-in replacement for dotenv-cli variable interpolation (expanding) is automatically enabled using dotenv-expand under the hood.
For example:
IP=127.0.0.1
PORT=1234
APP_URL=http://${IP}:${PORT}
Using the above example .env
file, process.env.APP_URL
will be resolved to http://127.0.0.1:1234
.