A zero-dependency CLI tool that compares your .env file against .env.example and tells you exactly what's missing, what's extra, and what's in sync.
Useful in CI pipelines, onboarding scripts, or just before deploying when you're not sure if your environment is complete.
Every team has that moment: a new dev clones the repo, runs the app, and it crashes because .env is missing three keys that were added two months ago and nobody updated the docs. This tool catches that before it becomes a problem.
# In your project root
node index.js
# Custom paths
node index.js .env.local .env.example
# Help
node index.js --helpenv-diff-checker — .env vs .env.example
✓ Matched keys: 4
✗ Missing in .env (2):
- DATABASE_URL
- REDIS_PASSWORD
⚠ Extra in .env not in .env.example (1):
+ MY_LOCAL_DEBUG_FLAG
| Code | Meaning |
|---|---|
0 |
All required keys present |
1 |
One or more keys missing (useful for CI) |
Add a check to your pipeline before deploy:
# GitHub Actions example
- name: Check env completeness
run: node env-diff-checker/index.js .env .env.exampleOr in a pre-deploy shell script:
node env-diff-checker/index.js || { echo "Fix your .env first!"; exit 1; }node test.jsPure Node.js, no npm install needed. Works on Node 14+.
If you're managing multiple projects, environments, or deployments, repetitive checks like this are a good candidate for automation. @anluyy_bot on Telegram offers AI-assisted deployment and automation services — handy if you want to wire up checks like this into a broader CI/CD or notification workflow without setting up extra infrastructure yourself.
MIT