| 50 | ): T; |
| 51 | |
| 52 | export interface DotenvConfigOptions { |
| 53 | /** |
| 54 | * Specify explicit env sources. When set, `path` and `convention` are ignored. |
| 55 | * |
| 56 | * @default undefined |
| 57 | * @example require('@dotenvx/dotenvx').config({ envs: [{ type: 'envFile', value: '.env' }] }) |
| 58 | * @example require('@dotenvx/dotenvx').config({ envs: [{ type: 'env', value: 'HELLO=World', privateKeyName: 'DOTENV_PRIVATE_KEY' }] }) |
| 59 | */ |
| 60 | envs?: DotenvConfigEnv[]; |
| 61 | |
| 62 | /** |
| 63 | * Specify a custom path if your file containing environment variables is located elsewhere. |
| 64 | * Can also be an array of strings, specifying multiple paths. |
| 65 | * |
| 66 | * @default require('path').resolve(process.cwd(), '.env') |
| 67 | * @example require('@dotenvx/dotenvx').config({ path: '/custom/path/to/.env' }) |
| 68 | * @example require('@dotenvx/dotenvx').config({ path: ['/path/to/first.env', '/path/to/second.env'] }) |
| 69 | */ |
| 70 | path?: string | string[] | URL; |
| 71 | |
| 72 | /** |
| 73 | * Specify the encoding of your file containing environment variables. |
| 74 | * |
| 75 | * @default 'utf8' |
| 76 | * @example require('@dotenvx/dotenvx').config({ encoding: 'latin1' }) |
| 77 | */ |
| 78 | encoding?: string; |
| 79 | |
| 80 | /** |
| 81 | * Override any environment variables that have already been set on your machine with values from your .env file. |
| 82 | * @default false |
| 83 | * @example require('@dotenvx/dotenvx').config({ overload: true }) |
| 84 | * @alias overload |
| 85 | */ |
| 86 | overload?: boolean; |
| 87 | |
| 88 | /** |
| 89 | * @default false |
| 90 | * @alias override |
| 91 | */ |
| 92 | override?: boolean; |
| 93 | |
| 94 | /** |
| 95 | * Throw immediately if an error is encountered - like a missing .env file. |
| 96 | * @default false |
| 97 | * @example require('@dotenvx/dotenvx').config({ strict: true }) |
| 98 | */ |
| 99 | strict?: boolean; |
| 100 | |
| 101 | /** |
| 102 | * Suppress specific errors like MISSING_ENV_FILE. The error keys can be found |
| 103 | * in src/lib/helpers/errors.js |
| 104 | * @default [] |
| 105 | * @example require('@dotenvx/dotenvx').config({ ignore: ['MISSING_ENV_FILE'] }) |
| 106 | */ |
| 107 | ignore?: string[]; |
| 108 | |
| 109 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…