@ev-fns/dotenv
v1.0.1
Published
> Safely loads environment variables
Downloads
19
Maintainers
Readme
@ev-fns/dotenv
Safely loads environment variables
- dotenv
dotenv: (props: DotenvProps) => void
Install
yarn add @ev-fns/dotenv
Usage
const { dotenv } = require("@ev-fns/dotenv");
dotenv();
Try it out
$ echo "NODE_ENV=" >.env.example
Invalid env variables
$ node index.js; echo $?
MissingEnvVarsError... ... missing: [ 'NODE_ENV' ], ... 1
Valid env variables
$ NODE_ENV=development VERSION=0.1.0 node index.js; echo $?
🌟 development 🔖 0.1.0 0