dotdoctor
v0.1.0
Published
The doctor for your .env files — like flutter doctor, but for environment variables.
Downloads
155
Maintainers
Readme
dotdoctor
The doctor for your .env files — like flutter doctor, but for environment variables.
dotdoctor reads your source code to find the environment variables it actually uses, parses your .env stack, and tells you which ones are missing, unused or invalid before the app starts. It scans JavaScript, TypeScript, Python, Go and Ruby.
$ npx dotdoctor check
dotdoctor v0.1.0 — scanned 5 files in 2ms
✗ DATABASE_URL required by the code but not defined in any env file src/db.ts:4
! LOG_LEVEL not defined (optional — the code provides a fallback) src/log.ts:3
✓ 8 other variables OK
1 error, 1 warning
→ add the missing variables to your env files, then re-run `dotdoctor check`Exit codes: 0 clean, 1 problems found, 2 dotdoctor could not run.
Install
npm install --save-dev dotdoctorThis package is a launcher. The actual binary arrives through one of the platform packages below, picked automatically by npm via os/cpu and listed here as optionalDependencies:
@dotdoctor/darwin-arm64 · @dotdoctor/darwin-x64 · @dotdoctor/linux-arm64 · @dotdoctor/linux-x64 · @dotdoctor/win32-x64
If you install with --no-optional, no binary is installed and dotdoctor will tell you which package to add.
Programmatic use
const { execFileSync } = require("child_process");
const { binaryPath } = require("dotdoctor");
const report = JSON.parse(execFileSync(binaryPath(), ["check", "--json"]));Documentation
Full docs, the env.schema.toml reference and the GitHub Actions recipe live in the repository README.
License
MIT
