EnvBang for Node.js
Ensure you have all the right environment variables set in your app.
Installation & Usage
As early as possible in your application require envbang and pass it your required environment variables.
EnvBang = ;envbang = 'NODE_ENV' 'PORT' 'MONGOHQ_URL';// Once initialized, run #check() to ensure your environment variables are presentenvbang;
If you are missing any environment variables, envbang will throw an error and give you a list of the variables you're missing:
The following required environment variables are missing:=> NODE_ENV=> PORT=> MONGOHQ_URL
Inspiration
This package is meant to be used as a companion to dotenv-node. We are big fans of configuration via environment variables, but it can occasionally get a little crazy when you have a team of developers trying to keep up with changes to a .env
file. The goal is to give clear feedback on application configuration to help reduce developer confusion and frustration.
References
- The Twelve Factor App
- jcamenisch/ENV_BANG - the original, written in Ruby
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Running tests
npm installnpm test