New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

verify-env

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verify-env

Utility module to verify that all required environment variables are set.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

node-verify-env

Small utility module to verify that all required environment variables are set.

How to use

At your application startup, invoke this module passing it a list of mandatory environment variables for your application. The module throws an exception if any of them missing.

var verifyEnv = require('verifyEnv')
  , mandatoryEnvVars;

mandatoryEnvVars = [
  'MYAPP_DB_CONN_STRING',
  'MYAPP_LOG_FILE_PATH'
];

verifyEnv.verify(mandatoryEnvVars);
// --- the program crashes here if any mandatory env var mising --- //

// --- continue initialization after this point --- //

The invocation should be made at the soonest possible point in your program execution, allowing it to crash the program in case of a misconfigured environment.

Changelog

  • v0.0.1 Initial release

Keywords

env

FAQs

Package last updated on 08 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts