2.0.0 • Published 6 months ago

require-environment-variables v2.0.0

Weekly downloads
3,177
License
MIT
Repository
github
Last release
6 months ago

require-environment-variables TypeScript

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