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.
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
Compares value equality between two env files