Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 --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