A zero-config, framework-agnostic NPM package that prevents runtime errors by validating your environment variables directly from your .env.example file.
npm install @arshtiwari/envguard
Everything you need to validate, document, and manage your environment variables
Works out-of-the-box with your existing .env.example file
Use in any Node.js or frontend project
Keeps .env.example up-to-date automatically
Validate env vars in scripts, CI, or app startup
Visualize, debug, and document env variables (dev only)
Friendly messages for missing/misconfigured variables
Simple, powerful, and zero-config environment variable validation
envguard reads your .env.example file to understand your environment variable requirements.
Automatically creates a validation schema based on your .env.example structure.
Checks your actual environment variables against the schema at runtime.
Provides clear error messages and optional UI for visualizing your environment.
# API Keys (required)
API_KEY=your-api-key-here
# Database connection (required)
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=password
# Feature flags (optional)
ENABLE_FEATURE_X=true
DEBUG_MODE=false
Get up and running in seconds with these simple commands
npx envguard validate
Output:
[envguard] Environment Variable Errors: - Missing required environment variable: API_KEY - Invalid value for DB_PORT: Expected number, got "string" error Command failed with exit code 1
Weekly Downloads
Latest Version
License
Unpacked Size
Hey everyone! I'm Arsh Tiwari, a 2nd-year CSE student at GGSIPU Delhi and also pursuing a B.S. in Data Science from IIT Madras (online).
I'm passionate about full-stack development, open-source collaboration, AI/LLMs, and building scalable systems. envguard is one of my contributions to making developer experience better.
Start validating your environment variables today and prevent runtime errors before they happen.