Built envguard to solve an itch
Every developer has broken a local build or a deployment at least once because of a missing environment variable.
You pull the latest code, run the start script, and the application immediately crashes because someone added a new API key or database URL to the codebase but forgot to tell the team to update their local .env files.
I got tired of tracking down vague runtime errors caused by mismatched environments, so I built envguard to solve this exact bottleneck. It ensures your .env completely satisfies your requirements before your app even tries to start, guaranteeing a stable run.
The Problem: Silent Configuration Failures
Standard .env management usually relies on documentation or a .env.example file that quickly goes out of date. There is no automated bridge between what your code expects and what your actual file provides.
When a variable is missing, your app might fail silently until a specific code path is hit, causing unpredictable behavior right when you're trying to run the application.
How envguard Fixes This
envguard introduces a strict validation step using a .env.schema file. It acts as a structural gatekeeper for your configuration right at execution time.
-
Schema-Based Validation: It parses your
.envand matches it against a defined.env.schematemplate. -
Fail-Fast Mechanics: If a variable is missing or structurally invalid,
envguardblocks the application startup and outputs a clean, explicit error showing exactly what is missing. - Stable Execution: By embedding this check directly into your application setup, you guarantee that the app cannot spin up unless its environment is 100% complete. Completely Open-source, forever.
Github:
virajshoor
/
envguard
Validate .env files against a typed .env.schema before bad config breaks your deploy. Offline-first CLI.
######## ## ## ## ## ###### ## ## ### ######## ########
## ### ## ## ## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ## ## ## ## ## ## ## ## ## ##
###### ## ## ## ## ## ## #### ## ## ## ## ######## ## ##
## ## #### ## ## ## ## ## ## ######### ## ## ## ##
## ## ### ## ## ## ## ## ## ## ## ## ## ## ##
######## ## ## ### ###### ####### ## ## ## ## ########
Validate your env config before it breaks your deploy.
A missing DATABASE_URL, a blank JWT_SECRET, a port set to banana, or a
production-only typo can take down a release after the code was already fine
envguard catches those mistakes where they belong: locally, in CI, and before
runtime.
It validates a…
Quick Start
Install the package:
npm install -g @virajshoor/envguard
Top comments (1)
Check out varlock.dev - its a mature solution that solves this. Key difference is that schema info is added using decorator style comments within an otherwise normal looking .env file. This means that the .env.schema file can contain values as well as schema. It also introduces a function call syntax to declaratively pull secrets from various backends, or compose values together. Tons of other nice features.
Also note - there are hundreds of tools named "envguard" popping up these days - do a search on github and you'll see.