🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

require-env-variable

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-env-variable

Require specific environment variables. If they don't exist, the application exits

4.0.2
latest
Source
npm
Version published
Weekly downloads
2.7K
13.63%
Maintainers
1
Weekly downloads
 
Created
Source

Install

pnpm add require-env-variable

or

yarn add require-env-variable

or

npm install require-env-variable

Usage

import { requireEnv } from "require-env-variable";

const { NODE_ENV, SSLKEY, SSLCERT, PORT } = requireEnv(
  "NODE_ENV",
  "SSLKEY",
  "SSLCERT",
  "PORT"
);

Returns the environment variables specified, but if any of the environment variables are not defined, the process exits (throws a catchable error).

Keywords

dotenv

FAQs

Package last updated on 17 Oct 2023

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