Interface DotenvConfigOptions

Hierarchy

  • DotenvConfigOptions

Properties

DOTENV_KEY?: string

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' })

debug?: boolean

Default: 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 })

encoding?: string

Default: utf8

Specify the encoding of your file containing environment variables.

example: require('dotenv').config({ encoding: 'latin1' })

override?: boolean

Default: 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 })

path?: string | URL

Default: 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' })

processEnv?: DotenvPopulateInput

Default: 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