require-env-variable
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

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

/require-env-variable/

    Package Sidebar

    Install

    npm i require-env-variable

    Weekly Downloads

    2,278

    Version

    4.0.2

    License

    MIT

    Unpacked Size

    2.98 kB

    Total Files

    5

    Last publish

    Collaborators

    • pablosz