@elricb/dotenv-config
v1.0.1
Published
Load .env environment variables
Readme
dotenv-config
Project .env loader.
Install
$ npm install --save-dev @elricb/dotenv-configUsage
Include and call with base directory. Searches up from base directory for .env.
CJS
const dotenv = require("@elricb/dotenv-config");
dotenv(__dirname);ESM
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
import dotenv from "@elricb/dotenv-config";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
dotenv(__dirname);package.json
Ensure your .env file is packaged with your build.
{
...
"files": [
".env",
...
],
}Documentation
Release Notes
View commit tag for release notes.
