A lightweight TypeScript CLI tool that validates your environment variables and ensures your .env files are correctly configured.
# Check a single environment variable
env-guard DATABASE_URL
# Load from a .env file, then validate keys
env-guard --env-file .env DATABASE_URL API_KEY
# Validate types (string, number, boolean)
env-guard DB_PORT:number API_ENABLED:boolean
# Show help
env-guard --helpnpm run build- Compile TypeScript to JavaScriptnpm start- Run CLI using ts-node (for development)npm test- Run tests with Jest
env-guard/
├─ src/
│ └─ index.ts # main CLI logic
├─ bin/
│ └─ env-guard.js # executable
├─ package.json
├─ README.md
└─ tests/
└─ env-guard.test.ts # test file
MIT