yarn add guardian-of-env --dev
in your project folder, execute guardian-of-env
, and guardian-of-env
compares .env
and .env.example
file by default.
npx guardian-of-env
or set more files that you want to compare
npx guardian-of-env .env .env.example .env.exmaple.example
install pre-commit
first, and follow the configuration of package.json below
{
"scripts": {
"guardian-of-env": "guardian-of-env"
},
"pre-commit": [
"guardian-of-env"
],
}
or you want to compare your .env files in the ci phase
{
"scripts": {
"guardian-of-env": "./node_modules/.bin/guardian-of-env .env .env.test"
},
}
script:
- yarn guardian-of-env