A simple tool to protect your environment variables by ensuring .env files never get committed to Git.
- Automatically adds
.envto.gitignoreif missing - Removes
.envfrom Git tracking if it was accidentally committed - Integrates with Husky for pre-commit protection
-
Install envwarden:
npm install envwarden
-
Initialize the package
npx envwarden init
That's it! envwarden will automatically protect your .env files from being committed to Git.
- Checks if
.envis in.gitignoreand adds it if missing - Detects if
.envis being tracked by Git and removes it from tracking - Uses Husky to prevent accidental commits of
.envfiles
- Peace of Mind:
No more "oh no" moments after a late-night push. - Team Safety:
Protects everyone on your team, even the new folks.