Optional
DOTENV_Optional
debugDefault: false
Turn on logging to help debug why certain keys or values are not being set as you expect.
example: require('dotenv').config({ debug: process.env.DEBUG })
Optional
encodingDefault: utf8
Specify the encoding of your file containing environment variables.
example: require('dotenv').config({ encoding: 'latin1' })
Optional
overrideDefault: false
Override any environment variables that have already been set on your machine with values from your .env file.
example: require('dotenv').config({ override: true })
Optional
pathDefault: path.resolve(process.cwd(), '.env')
Specify a custom path if your file containing environment variables is located elsewhere.
example: require('dotenv').config({ path: '/custom/path/to/.env' })
Optional
processDefault: process.env
Specify an object to write your secrets to. Defaults to process.env environment variables.
example: const processEnv = {}; require('dotenv').config({ processEnv: processEnv })
Generated using TypeDoc
Default:
undefined
Pass the DOTENV_KEY directly to config options. Defaults to looking for process.env.DOTENV_KEY environment variable. Note this only applies to decrypting .env.vault files. If passed as null or undefined, or not passed at all, dotenv falls back to its traditional job of parsing a .env file.
example:
require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234…@dotenv.org/vault/.env.vault?environment=production' })