This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@donutteam/environment-variable-utilities
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Environment Variable Utilities

A collection of various environment variable related utility functions.

This pairs great with the dotenv package.

Installation

Install the package with NPM:

npm install @donutteam/environment-variable-utilities

Usage

checkEnvironmentVariables

This function checks that each of the environment variables in the given array exists and returns whether or not they all exist.

import { checkEnvironmentVariables } from "@donutteam/environment-variable-utilities";

const variablesExist = checkEnvironmentVariables(
	[
		"PORT",

		"SOME_SECRET_API_KEY",
	]);

requireEnvironmentVariables

This function checks that each of the environment variables in the given array exists and terminates the process if any of them are missing.

This assures that the process will not run in unexpected ways due to a missing environment variable.

import { requireEnvironmentVariables } from "@donutteam/environment-variable-utilities";

requireEnvironmentVariables(
	[
		"PORT",

		"SOME_SECRET_API_KEY",
	]);

License

MIT

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i @donutteam/environment-variable-utilities

    Weekly Downloads

    10

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    4.97 kB

    Total Files

    5

    Last publish

    Collaborators

    • duckdotexe