Skip to content

neocrev/envshield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envshield

Validate your .env before your app crashes at 3am.

npm License

envshield in action


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=info

Then run:

npx @neocrev/envshield

If something's missing, you'll know immediately.


Integrations

# CI
- run: npx @neocrev/envshield --strict
COPY .env.schema ./
RUN npx @neocrev/envshield
# pre-commit hook
npx @neocrev/envshield --strict

Options

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

Pull Shark test

shark2

About

Pre-flight check for your .env — before your app crashes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors