Back to directory
bjoshuanoah avatar
bjoshuanoah / require-environment-variables

require-environment-variables

Require environment variables for your node.js application

46

Stars

8

Forks

4

Watchers

MIT

License

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

Releases

2.0

Oct 20, 2023

Download .zip

What's Changed

update travis requirements, update build, return object of env var va… by @bjoshuanoah in #7 updated package to use jest, added ts support by @etnlbck in #8 Bump @babel/traverse from 7...

Contributors

4 contributors by commits. Profile dekhne ke liye kisi bhi developer par click karein.