Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjoshuanoah/require-environment-variables
Require environment variables for your node.js application
https://github.com/bjoshuanoah/require-environment-variables
code code-quality dotenv env environment-variables hacktoberfest javascript node-js npm-package npmjs typescript
Last synced: 24 days ago
JSON representation
Require environment variables for your node.js application
- Host: GitHub
- URL: https://github.com/bjoshuanoah/require-environment-variables
- Owner: bjoshuanoah
- License: mit
- Created: 2015-05-20T21:39:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-10-20T16:29:55.000Z (about 1 year ago)
- Last Synced: 2024-09-28T15:21:03.538Z (about 1 month ago)
- Topics: code, code-quality, dotenv, env, environment-variables, hacktoberfest, javascript, node-js, npm-package, npmjs, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/require-environment-variables
- Size: 354 KB
- Stars: 44
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# require-environment-variables [![TypeScript](https://badges.frapsoft.com/typescript/code/typescript.svg?v=101)](https://github.com/ellerbrock/typescript-badges/)
## Install
npm
npm install require-environment-variables --saveyarn
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