config({ cwd: … })

Choose the base directory for relative paths

Node.js config

dotenvx.config({ cwd: '/srv/app', path: '.env.production' })

Usage

Defaults to process.cwd(). Relative file and key paths are resolved by the shared loader from this directory.


const dotenvx = require('@dotenvx/dotenvx')
dotenvx.config({ cwd: '/srv/app', path: '.env.production' })

markdown