0.1.5 • Published 2 years ago
@dot/env v0.1.5
@dot/env
Load environment variables from .env files.
This tiny package composes a few packages in order to load .env intelligently:
dotenvdotenv-expandfind-up
Differences with dotenv:
- Automatically expands variables such as
${NODE_ENV}within the.envfiles - Searches the immediate directory (current working directory) for an
.envfile, and if not found, continues to look in parent directories until a.envfile is found, or.gitis encountered.
Possible future features:
- Composing multiple
.envfiles - Extending
.envfiles
Requirements
This package requires an Active LTS Node version (v18+).
Install
Using pnpm:
pnpm add @dot/envUsage
Usage is straightforward:
import '@dot/env';That's it. You're good to go.