Skip to content

DiegoTorres/simple-validation-for-env-variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

simple-validation-for-env-variables

It throws exception if required env variables are missing.

 

Getting Started

Install it using npm:

npm i @diegoti/simple-validation-for-env-variables

USAGE

Import simple-validation-for-env-variables in your node app. Call check() function passing an array of ENV variables. If a variable is missing, the package will prevent the application from starting.

var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');

const simpleValidationForEnvVariables = require('@diegoti/simple-validation-for-env-variables');
simpleValidationForEnvVariables.check(["MONGO_URL", "USER"]);

Output example.

Error: 
Missing env[MONGO_URL] variable.

About

It throws exception if required env variables are missing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published