expect-env
v1.0.1
Published
Expect that an env variable exists
Downloads
5,259
Readme
expect-env
Acts as a proxy to process.env: checks if an environment variable is set when accessed. Throws an error if the variable is not set.
Usage
import { env } from "expect-env";
// Access an environment variable
console.log(env.HOME); // returns the value if set
// Throws if the variable is not set
console.log(env.FOO_BAR); // throws Error: process.env.FOO_BAR is not set!