env-scripts
v1.1.0
Published
A collection of scripts to perform actions related to .env files.
Downloads
10
Maintainers
Readme
Commands
npx env-scripts diff <source-env-relative-path> <destination-env-relative-path>
Compares environment variables defined in both env files, and reports any variables missing in either.
Example:
Given
# .env.example
TEST_VAR_1=AAA
TEST_VAR_2=BBB
# .env
TEST_VAR_1=AAA
TEST_VAR_3=CCC
running
npx env-scripts diff .env.example .env
:
will result in
Missing:
TEST_VAR_2
Extra:
TEST_VAR_3
Where "Missing" represents variables defined in .env.example
but that are not found in .env
, and "Extra" represents the inverse.
npx env-scripts sort <env-file-relative-path>
Reads the env file and writes to a new file named <env-file>-sorted
Example:
npx env-scripts sort .env
-> writes to a file named .env-sorted
npx env-scripts diff-values <env-1> <env-2>
Compares value equality between two env files