@sadbox/env-snapshot
v0.3.1
Published
A tool for creating a copy of env variables.
Downloads
9
Readme
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