You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Dominik Dzienia 20ebc2e23c Version 1.0.0 2 years ago
src Version 1.0.0 2 years ago
.env Version 1.0.0 2 years ago
.gitignore Version 1.0.0 2 years ago
.npmrc Version 1.0.0 2 years ago
.prettierrc Version 1.0.0 2 years ago
README.md Version 1.0.0 2 years ago
jest.config.js Version 1.0.0 2 years ago
package-lock.json Version 1.0.0 2 years ago
package.json Version 1.0.0 2 years ago
tsconfig-base.json Version 1.0.0 2 years ago
tsconfig-esm.json Version 1.0.0 2 years ago
tsconfig.json Version 1.0.0 2 years ago
update-versions.js Version 1.0.0 2 years ago

README.md

The command line tool to read, manipulate and update .env files.

Setup

npm install -g dotenv-tool --registry https://npm.dzienia.pl

Command Line

If input or output file(s) are not specified, dotenv-tool will use stdin or stdout

$ echo -n "VAR1=value1\nVAR2=value2" | dotenv-tool read VAR1 > result.txt
$ cat result.txt
value1

Modify files

$ dotenv-tool -h
Usage: dotenv-tool [options] [command] [paramsToSet]

Tool to read and update .env files

Arguments:
  paramsToSet                  space separated list of additional envs to set, in format key=value (default: "")

Options:
  -v, --version                output the version number
  -i, --files <filePaths...>   Input file(s)
  -o, --outputFile <filePath>  Output file
  -m, --modify                 Modify first input file
  -s, --silent                 Mute all messages and errors
  -h, --help                   display help for command

Commands:
  get [options] <key>          Returns given variable from env file (if specified)

Read prop from file

$ dotenv-tool get -h
Usage: dotenv-tool get [options] <key>

Returns given variable from env file (if specified)

Arguments:
  key                    env variable name a.k.a. key

Options:
  -f, --file <filePath>  Input file to parse (if not given, stdio is used)
  -h, --help             display help for command