env-example-drift
v0.1.2
Published
Check that .env and .env.example contain the same variable names.
Maintainers
Readme
env-example-drift
Check that .env and .env.example contain the same variable names.
It is intentionally small: values are ignored, only keys are compared. This makes it useful in CI without leaking secrets.
Usage
npx env-example-driftCustom file names:
npx env-example-drift --example .env.sample --env .env.localExample
.env.example:
DATABASE_URL=
PORT=3000.env:
DATABASE_URL=postgres://localhost/appOutput:
Missing in .env: PORTWhy
Teams often update .env locally and forget to update .env.example, or add a required example key that is missing locally. This tiny check catches that drift before onboarding or deploys break.
License
MIT
API
The env-example-drift CLI compares variable names in .env and .env.example and exits non-zero when they differ.
npx env-example-drift --example .env.example --env .envLimitations
Values are not compared, and dotenv files are parsed for variable names only. Never commit real secrets.
