Skip to content

strayiker/env-snapshot

Repository files navigation

Version License Dependencies Build Status

Env Snapshot

A tool for creating a statically accessible copy of process.env variables.

Installation

npm install @sadbox/env-snapshot

yarn add @sadbox/env-snapshot

Usage

import { takeEnvSnapshot } from '@sadbox/env-snapshot';

const env = takeEnvSnapshot();

env.NODE_ENV; // production
env.nodeEnv; // production

It uses dotenv lib under the hood, so next is valid.

#.env
CUSTOM_OPTION=value
const env = takeEnvSnapshot();

env.CUSTOM_OPTION; // value
env.customOption; // value

About

A tool for creating a copy of env variables.

Resources

License

Stars

Watchers

Forks

Packages

No packages published