require-environment-variables
v2.0.0
Published
Require specific environment variables. If they don't exist, the application exits
Downloads
6,331
Readme
require-environment-variables
Install
npm
npm install require-environment-variables --save
yarn
yarn add require-environment-variables
Usage
js
const requireEnv = require("require-environment-variables");
requireEnv(['GOOGLEANALYTICSID', 'SSLKEY', 'SSLCERT', 'SSLCA']);
ts
import requireEnv from 'require-environment-variables'
requireEnv(['GOOGLEANALYTICSID', 'SSLKEY', 'SSLCERT', 'SSLCA']);
If any of the environment variables(process.env.GOOGLEANALYTICSID) don't exist, the process exits with code 400
Contribute
Update and add tests to tests/**/*.spec.ts
Pull requests will verify that tests pass