dotenv-audit v1.1.0 — now with .env.example auto-sync
This is a follow-up to my previous article: I built a CLI tool that auto-detects missing environment variables — no schema needed Quick update on dotenv-audit — the CLI tool that scans your code an...

Source: DEV Community
This is a follow-up to my previous article: I built a CLI tool that auto-detects missing environment variables — no schema needed Quick update on dotenv-audit — the CLI tool that scans your code and finds missing environment variables. What's new in v1.1.0 1. sync command — keep .env.example in sync with your code The most common problem with .env.example files? They go outdated. Someone adds a new process.env.STRIPE_KEY in code but forgets to update .env.example. New developers clone the repo, miss the variable, and waste time debugging. Now just run: npx dotenv-audit sync It will: Scan your code for every process.env usage Compare with your existing .env.example Add missing variables with smart placeholder values Warn about unused variables that should be removed # .env.example PORT=3000 DATABASE_URL= JWT_SECRET= OLD_UNUSED_VAR=something After running npx dotenv-audit sync: dotenv-audit sync Scanned 12 files + 2 variable(s) missing from .env.example: + API_KEY app.js:3 + STRIPE_KEY p