Validate your env variables
Avoid the scenerio where your app doesn't work properly because you're missing an environment variable.
Installation
$ npm install validate-env --save# ... or $ yarn add validate-env
Usage Examples:
1. First option is to use validateEnvVariables
default functionality, which throws an Error
on failure.
const validateEnvVariables = ; try ; catch error console; process;
2. Or you can disable throwsOnFailure
functionality, meaning validateEnvVariables
will now return false
when env variables are invalid.
const validateEnvVariables = ; if ! console; process;