MCPcopy
hub / github.com/motdotla/dotenv / config

Function config

lib/main.js:320–336  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

318
319// Populates process.env from .env file
320function config (options) {
321 // fallback to original dotenv if DOTENV_KEY is not set
322 if (_dotenvKey(options).length === 0) {
323 return DotenvModule.configDotenv(options)
324 }
325
326 const vaultPath = _vaultPath(options)
327
328 // dotenvKey exists but .env.vault file does not exist
329 if (!vaultPath) {
330 _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`)
331
332 return DotenvModule.configDotenv(options)
333 }
334
335 return DotenvModule._configVault(options)
336}
337
338function decrypt (encrypted, keyStr) {
339 const key = Buffer.from(keyStr.slice(-64), 'hex')

Callers 1

test.tsFile · 0.85

Calls 3

_dotenvKeyFunction · 0.85
_vaultPathFunction · 0.85
_warnFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…