preload

Load environment values before application modules execute

Node.js

import '@dotenvx/dotenvx/config'

Usage

Load before application modules execute. CommonJS and ESM are both supported.


$ node --require @dotenvx/dotenvx/config app.cjs

$ node --import @dotenvx/dotenvx/config app.mjs

import '@dotenvx/dotenvx/config'

DOTENV_CONFIG_PATH selects a preload path when DOTENV_FILE and DOTENV_PATH are absent. Use DOTENV_QUIET=true to suppress the summary.

markdown