@neocrev/envshield
v1.0.0
Published
.env validator — catches missing vars before your app crashes
Downloads
166
Maintainers
Readme
You deploy. The app starts. Then it dies because DATABASE_URL doesn't exist in production. envshield catches that before a single request is served.
Setup
Write a schema:
# .env.schema
DATABASE_URL=required
STRIPE_SECRET_KEY=required
PORT=3000
LOG_LEVEL=infoThen run:
npx @neocrev/envshieldIf something's missing, you'll know immediately.
Integrations
# CI
- run: npx @neocrev/envshield --strictCOPY .env.schema ./
RUN npx @neocrev/envshield# pre-commit hook
npx @neocrev/envshield --strictOptions
| Flag | Description | Default |
|------|-------------|---------|
| -s, --schema | Path to schema file | .env.schema |
| -e, --env | Path to env file | .env |
| -t, --strict | Fail on missing required fields | warn only |
| -i, --init | Generate schema from .env.example | |
| -h, --help | Show help | |
License
MIT
