dotenv-express 17.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SECURITY.md ADDED
@@ -0,0 +1 @@
1
+ Please report any security vulnerabilities to security@dotenvx.com.
package/config.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/config.js ADDED
@@ -0,0 +1,9 @@
1
+ (function () {
2
+ require('./lib/main').config(
3
+ Object.assign(
4
+ {},
5
+ require('./lib/env-options'),
6
+ require('./lib/cli-options')(process.argv)
7
+ )
8
+ )
9
+ })()
@@ -0,0 +1,17 @@
1
+ const re = /^dotenv_config_(encoding|path|quiet|debug|override|DOTENV_KEY)=(.+)$/
2
+
3
+ module.exports = function optionMatcher (args) {
4
+ const options = args.reduce(function (acc, cur) {
5
+ const matches = cur.match(re)
6
+ if (matches) {
7
+ acc[matches[1]] = matches[2]
8
+ }
9
+ return acc
10
+ }, {})
11
+
12
+ if (!('quiet' in options)) {
13
+ options.quiet = 'true'
14
+ }
15
+
16
+ return options
17
+ }
@@ -0,0 +1,28 @@
1
+ // ../config.js accepts options via environment variables
2
+ const options = {}
3
+
4
+ if (process.env.DOTENV_CONFIG_ENCODING != null) {
5
+ options.encoding = process.env.DOTENV_CONFIG_ENCODING
6
+ }
7
+
8
+ if (process.env.DOTENV_CONFIG_PATH != null) {
9
+ options.path = process.env.DOTENV_CONFIG_PATH
10
+ }
11
+
12
+ if (process.env.DOTENV_CONFIG_QUIET != null) {
13
+ options.quiet = process.env.DOTENV_CONFIG_QUIET
14
+ }
15
+
16
+ if (process.env.DOTENV_CONFIG_DEBUG != null) {
17
+ options.debug = process.env.DOTENV_CONFIG_DEBUG
18
+ }
19
+
20
+ if (process.env.DOTENV_CONFIG_OVERRIDE != null) {
21
+ options.override = process.env.DOTENV_CONFIG_OVERRIDE
22
+ }
23
+
24
+ if (process.env.DOTENV_CONFIG_DOTENV_KEY != null) {
25
+ options.DOTENV_KEY = process.env.DOTENV_CONFIG_DOTENV_KEY
26
+ }
27
+
28
+ module.exports = options
package/lib/main.d.ts ADDED
@@ -0,0 +1,179 @@
1
+ // TypeScript Version: 3.0
2
+ /// <reference types="node" />
3
+ import type { URL } from 'url';
4
+
5
+ export interface DotenvParseOutput {
6
+ [name: string]: string;
7
+ }
8
+
9
+ export interface DotenvPopulateOutput {
10
+ [name: string]: string;
11
+ }
12
+
13
+ /**
14
+ * Parses a string or buffer in the .env file format into an object.
15
+ *
16
+ * See https://dotenvx.com/docs
17
+ *
18
+ * @param src - contents to be parsed. example: `'DB_HOST=localhost'`
19
+ * @returns an object with keys and values based on `src`. example: `{ DB_HOST : 'localhost' }`
20
+ */
21
+ export function parse<T extends DotenvParseOutput = DotenvParseOutput>(
22
+ src: string | Buffer
23
+ ): T;
24
+
25
+ export interface DotenvConfigOptions {
26
+ /**
27
+ * Default: `path.resolve(process.cwd(), '.env')`
28
+ *
29
+ * Specify a custom path if your file containing environment variables is located elsewhere.
30
+ * Can also be an array of strings, specifying multiple paths.
31
+ *
32
+ * example: `require('dotenv').config({ path: '/custom/path/to/.env' })`
33
+ * example: `require('dotenv').config({ path: ['/path/to/first.env', '/path/to/second.env'] })`
34
+ */
35
+ path?: string | string[] | URL;
36
+
37
+ /**
38
+ * Default: `utf8`
39
+ *
40
+ * Specify the encoding of your file containing environment variables.
41
+ *
42
+ * example: `require('dotenv').config({ encoding: 'latin1' })`
43
+ */
44
+ encoding?: string;
45
+
46
+ /**
47
+ * Default: `false`
48
+ *
49
+ * Suppress all output (except errors).
50
+ *
51
+ * example: `require('dotenv').config({ quiet: true })`
52
+ */
53
+ quiet?: boolean;
54
+
55
+ /**
56
+ * Default: `false`
57
+ *
58
+ * Turn on logging to help debug why certain keys or values are not being set as you expect.
59
+ *
60
+ * example: `require('dotenv').config({ debug: process.env.DEBUG })`
61
+ */
62
+ debug?: boolean;
63
+
64
+ /**
65
+ * Default: `false`
66
+ *
67
+ * Override any environment variables that have already been set on your machine with values from your .env file.
68
+ *
69
+ * example: `require('dotenv').config({ override: true })`
70
+ */
71
+ override?: boolean;
72
+
73
+ /**
74
+ * Default: `process.env`
75
+ *
76
+ * Specify an object to write your secrets to. Defaults to process.env environment variables.
77
+ *
78
+ * example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })`
79
+ */
80
+ processEnv?: DotenvPopulateInput;
81
+
82
+ /**
83
+ * Default: `undefined`
84
+ *
85
+ * 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.
86
+ *
87
+ * example: `require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234…@dotenvx.com/vault/.env.vault?environment=production' })`
88
+ */
89
+ DOTENV_KEY?: string;
90
+ }
91
+
92
+ export interface DotenvConfigOutput {
93
+ error?: DotenvError;
94
+ parsed?: DotenvParseOutput;
95
+ }
96
+
97
+ type DotenvError = Error & {
98
+ code:
99
+ | 'MISSING_DATA'
100
+ | 'INVALID_DOTENV_KEY'
101
+ | 'NOT_FOUND_DOTENV_ENVIRONMENT'
102
+ | 'DECRYPTION_FAILED'
103
+ | 'OBJECT_REQUIRED';
104
+ }
105
+
106
+ export interface DotenvPopulateOptions {
107
+ /**
108
+ * Default: `false`
109
+ *
110
+ * Turn on logging to help debug why certain keys or values are not being set as you expect.
111
+ *
112
+ * example: `require('dotenv').populate(processEnv, parsed, { debug: true })`
113
+ */
114
+ debug?: boolean;
115
+
116
+ /**
117
+ * Default: `false`
118
+ *
119
+ * Override any environment variables that have already been set on your machine with values from your .env file.
120
+ *
121
+ * example: `require('dotenv').populate(processEnv, parsed, { override: true })`
122
+ */
123
+ override?: boolean;
124
+ }
125
+
126
+ export interface DotenvPopulateInput {
127
+ [name: string]: string | undefined;
128
+ }
129
+
130
+ /**
131
+ * Loads `.env` file contents into process.env by default. If `DOTENV_KEY` is present, it smartly attempts to load encrypted `.env.vault` file contents into process.env.
132
+ *
133
+ * See https://dotenvx.com/docs
134
+ *
135
+ * @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', quiet: false, debug: true, override: false }`
136
+ * @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } }
137
+ *
138
+ */
139
+ export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
140
+
141
+ /**
142
+ * Loads `.env` file contents into process.env.
143
+ *
144
+ * See https://dotenvx.com/docs
145
+ *
146
+ * @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', quiet: false, debug: true, override: false }`
147
+ * @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } }
148
+ *
149
+ */
150
+ export function configDotenv(options?: DotenvConfigOptions): DotenvConfigOutput;
151
+
152
+ /**
153
+ * Loads `source` json contents into `target` like process.env.
154
+ *
155
+ * See https://dotenvx.com/docs
156
+ *
157
+ * @param processEnv - the target JSON object. in most cases use process.env but you can also pass your own JSON object
158
+ * @param parsed - the source JSON object
159
+ * @param options - additional options. example: `{ debug: true, override: false }`
160
+ * @returns an object with the keys and values that were actually set
161
+ *
162
+ */
163
+ export function populate(
164
+ processEnv: DotenvPopulateInput,
165
+ parsed: DotenvPopulateInput,
166
+ options?: DotenvPopulateOptions
167
+ ): DotenvPopulateOutput;
168
+
169
+ /**
170
+ * Decrypt ciphertext
171
+ *
172
+ * See https://dotenvx.com/docs
173
+ *
174
+ * @param encrypted - the encrypted ciphertext string
175
+ * @param keyStr - the decryption key string
176
+ * @returns {string}
177
+ *
178
+ */
179
+ export function decrypt(encrypted: string, keyStr: string): string;
package/lib/main.js ADDED
@@ -0,0 +1,424 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+ const os = require('os')
4
+ const crypto = require('crypto')
5
+
6
+ // Array of tips to display randomly
7
+ const TIPS = [
8
+ '◈ encrypted .env [www.dotenvx.com]',
9
+ '◈ secrets for agents [www.dotenvx.com]',
10
+ '✦ add agent skills [npx skills add motdotla/dotenv]',
11
+ '⌁ auth for agents [www.vestauth.com]',
12
+ '⌘ custom filepath { path: \'/custom/path/.env\' }',
13
+ '⌘ enable debugging { debug: true }',
14
+ '⌘ override existing { override: true }',
15
+ '⌘ suppress logs { quiet: true }',
16
+ '⌘ multiple files { path: [\'.env.local\', \'.env\'] }'
17
+ ]
18
+
19
+ // Get a random tip from the tips array
20
+ function _getRandomTip () {
21
+ return TIPS[Math.floor(Math.random() * TIPS.length)]
22
+ }
23
+
24
+ function parseBoolean (value) {
25
+ if (typeof value === 'string') {
26
+ return !['false', '0', 'no', 'off', ''].includes(value.toLowerCase())
27
+ }
28
+ return Boolean(value)
29
+ }
30
+
31
+ function supportsAnsi () {
32
+ return process.stdout.isTTY // && process.env.TERM !== 'dumb'
33
+ }
34
+
35
+ function dim (text) {
36
+ return supportsAnsi() ? `\x1b[2m${text}\x1b[0m` : text
37
+ }
38
+
39
+ const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg
40
+
41
+ // Parse src into an Object
42
+ function parse (src) {
43
+ const obj = {}
44
+
45
+ // Convert buffer to string
46
+ let lines = src.toString()
47
+
48
+ // Convert line breaks to same format
49
+ lines = lines.replace(/\r\n?/mg, '\n')
50
+
51
+ let match
52
+ while ((match = LINE.exec(lines)) != null) {
53
+ const key = match[1]
54
+
55
+ // Default undefined or null to empty string
56
+ let value = (match[2] || '')
57
+
58
+ // Remove whitespace
59
+ value = value.trim()
60
+
61
+ // Check if double quoted
62
+ const maybeQuote = value[0]
63
+
64
+ // Remove surrounding quotes
65
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2')
66
+
67
+ // Expand newlines if double quoted
68
+ if (maybeQuote === '"') {
69
+ value = value.replace(/\\n/g, '\n')
70
+ value = value.replace(/\\r/g, '\r')
71
+ }
72
+
73
+ // Add to object
74
+ obj[key] = value
75
+ }
76
+
77
+ return obj
78
+ }
79
+
80
+ function _parseVault (options) {
81
+ options = options || {}
82
+
83
+ const vaultPath = _vaultPath(options)
84
+ options.path = vaultPath // parse .env.vault
85
+ const result = DotenvModule.configDotenv(options)
86
+ if (!result.parsed) {
87
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)
88
+ err.code = 'MISSING_DATA'
89
+ throw err
90
+ }
91
+
92
+ // handle scenario for comma separated keys - for use with key rotation
93
+ // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
94
+ const keys = _dotenvKey(options).split(',')
95
+ const length = keys.length
96
+
97
+ let decrypted
98
+ for (let i = 0; i < length; i++) {
99
+ try {
100
+ // Get full key
101
+ const key = keys[i].trim()
102
+
103
+ // Get instructions for decrypt
104
+ const attrs = _instructions(result, key)
105
+
106
+ // Decrypt
107
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)
108
+
109
+ break
110
+ } catch (error) {
111
+ // last key
112
+ if (i + 1 >= length) {
113
+ throw error
114
+ }
115
+ // try next key
116
+ }
117
+ }
118
+
119
+ // Parse decrypted .env string
120
+ return DotenvModule.parse(decrypted)
121
+ }
122
+
123
+ function _warn (message) {
124
+ console.error(`⚠ ${message}`)
125
+ }
126
+
127
+ function _debug (message) {
128
+ console.log(`┆ ${message}`)
129
+ }
130
+
131
+ function _log (message) {
132
+ console.log(`◇ ${message}`)
133
+ }
134
+
135
+ function _dotenvKey (options) {
136
+ // prioritize developer directly setting options.DOTENV_KEY
137
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
138
+ return options.DOTENV_KEY
139
+ }
140
+
141
+ // secondary infra already contains a DOTENV_KEY environment variable
142
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
143
+ return process.env.DOTENV_KEY
144
+ }
145
+
146
+ // fallback to empty string
147
+ return ''
148
+ }
149
+
150
+ function _instructions (result, dotenvKey) {
151
+ // Parse DOTENV_KEY. Format is a URI
152
+ let uri
153
+ try {
154
+ uri = new URL(dotenvKey)
155
+ } catch (error) {
156
+ if (error.code === 'ERR_INVALID_URL') {
157
+ const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')
158
+ err.code = 'INVALID_DOTENV_KEY'
159
+ throw err
160
+ }
161
+
162
+ throw error
163
+ }
164
+
165
+ // Get decrypt key
166
+ const key = uri.password
167
+ if (!key) {
168
+ const err = new Error('INVALID_DOTENV_KEY: Missing key part')
169
+ err.code = 'INVALID_DOTENV_KEY'
170
+ throw err
171
+ }
172
+
173
+ // Get environment
174
+ const environment = uri.searchParams.get('environment')
175
+ if (!environment) {
176
+ const err = new Error('INVALID_DOTENV_KEY: Missing environment part')
177
+ err.code = 'INVALID_DOTENV_KEY'
178
+ throw err
179
+ }
180
+
181
+ // Get ciphertext payload
182
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`
183
+ const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION
184
+ if (!ciphertext) {
185
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)
186
+ err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'
187
+ throw err
188
+ }
189
+
190
+ return { ciphertext, key }
191
+ }
192
+
193
+ function _vaultPath (options) {
194
+ let possibleVaultPath = null
195
+
196
+ if (options && options.path && options.path.length > 0) {
197
+ if (Array.isArray(options.path)) {
198
+ for (const filepath of options.path) {
199
+ if (fs.existsSync(filepath)) {
200
+ possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`
201
+ }
202
+ }
203
+ } else {
204
+ possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`
205
+ }
206
+ } else {
207
+ possibleVaultPath = path.resolve(process.cwd(), '.env.vault')
208
+ }
209
+
210
+ if (fs.existsSync(possibleVaultPath)) {
211
+ return possibleVaultPath
212
+ }
213
+
214
+ return null
215
+ }
216
+
217
+ function _resolveHome (envPath) {
218
+ return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
219
+ }
220
+
221
+ function _configVault (options) {
222
+ const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || (options && options.debug))
223
+ const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || (options && options.quiet))
224
+
225
+ if (debug || !quiet) {
226
+ _log('loading env from encrypted .env.vault')
227
+ }
228
+
229
+ const parsed = DotenvModule._parseVault(options)
230
+
231
+ let processEnv = process.env
232
+ if (options && options.processEnv != null) {
233
+ processEnv = options.processEnv
234
+ }
235
+
236
+ DotenvModule.populate(processEnv, parsed, options)
237
+
238
+ return { parsed }
239
+ }
240
+
241
+ function configDotenv (options) {
242
+ const dotenvPath = path.resolve(process.cwd(), '.env')
243
+ let encoding = 'utf8'
244
+ let processEnv = process.env
245
+ if (options && options.processEnv != null) {
246
+ processEnv = options.processEnv
247
+ }
248
+ let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || (options && options.debug))
249
+ let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || (options && options.quiet))
250
+
251
+ if (options && options.encoding) {
252
+ encoding = options.encoding
253
+ } else {
254
+ if (debug) {
255
+ _debug('no encoding is specified (UTF-8 is used by default)')
256
+ }
257
+ }
258
+
259
+ let optionPaths = [dotenvPath] // default, look for .env
260
+ if (options && options.path) {
261
+ if (!Array.isArray(options.path)) {
262
+ optionPaths = [_resolveHome(options.path)]
263
+ } else {
264
+ optionPaths = [] // reset default
265
+ for (const filepath of options.path) {
266
+ optionPaths.push(_resolveHome(filepath))
267
+ }
268
+ }
269
+ }
270
+
271
+ // Build the parsed data in a temporary object (because we need to return it). Once we have the final
272
+ // parsed data, we will combine it with process.env (or options.processEnv if provided).
273
+ let lastError
274
+ const parsedAll = {}
275
+ for (const path of optionPaths) {
276
+ try {
277
+ // Specifying an encoding returns a string instead of a buffer
278
+ const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))
279
+
280
+ DotenvModule.populate(parsedAll, parsed, options)
281
+ } catch (e) {
282
+ if (debug) {
283
+ _debug(`failed to load ${path} ${e.message}`)
284
+ }
285
+ lastError = e
286
+ }
287
+ }
288
+
289
+ const populated = DotenvModule.populate(processEnv, parsedAll, options)
290
+
291
+ // handle user settings DOTENV_CONFIG_ options inside .env file(s)
292
+ debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug)
293
+ quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet)
294
+
295
+ if (debug || !quiet) {
296
+ const keysCount = Object.keys(populated).length
297
+ const shortPaths = []
298
+ for (const filePath of optionPaths) {
299
+ try {
300
+ const relative = path.relative(process.cwd(), filePath)
301
+ shortPaths.push(relative)
302
+ } catch (e) {
303
+ if (debug) {
304
+ _debug(`failed to load ${filePath} ${e.message}`)
305
+ }
306
+ lastError = e
307
+ }
308
+ }
309
+
310
+ _log(`injected env (${keysCount}) from ${shortPaths.join(',')} ${dim(`// tip: ${_getRandomTip()}`)}`)
311
+ }
312
+
313
+ if (lastError) {
314
+ return { parsed: parsedAll, error: lastError }
315
+ } else {
316
+ return { parsed: parsedAll }
317
+ }
318
+ }
319
+
320
+ // Populates process.env from .env file
321
+ function config (options) {
322
+ // fallback to original dotenv if DOTENV_KEY is not set
323
+ if (_dotenvKey(options).length === 0) {
324
+ return DotenvModule.configDotenv(options)
325
+ }
326
+
327
+ const vaultPath = _vaultPath(options)
328
+
329
+ // dotenvKey exists but .env.vault file does not exist
330
+ if (!vaultPath) {
331
+ _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`)
332
+
333
+ return DotenvModule.configDotenv(options)
334
+ }
335
+
336
+ return DotenvModule._configVault(options)
337
+ }
338
+
339
+ function decrypt (encrypted, keyStr) {
340
+ const key = Buffer.from(keyStr.slice(-64), 'hex')
341
+ let ciphertext = Buffer.from(encrypted, 'base64')
342
+
343
+ const nonce = ciphertext.subarray(0, 12)
344
+ const authTag = ciphertext.subarray(-16)
345
+ ciphertext = ciphertext.subarray(12, -16)
346
+
347
+ try {
348
+ const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)
349
+ aesgcm.setAuthTag(authTag)
350
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
351
+ } catch (error) {
352
+ const isRange = error instanceof RangeError
353
+ const invalidKeyLength = error.message === 'Invalid key length'
354
+ const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'
355
+
356
+ if (isRange || invalidKeyLength) {
357
+ const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')
358
+ err.code = 'INVALID_DOTENV_KEY'
359
+ throw err
360
+ } else if (decryptionFailed) {
361
+ const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')
362
+ err.code = 'DECRYPTION_FAILED'
363
+ throw err
364
+ } else {
365
+ throw error
366
+ }
367
+ }
368
+ }
369
+
370
+ // Populate process.env with parsed values
371
+ function populate (processEnv, parsed, options = {}) {
372
+ const debug = Boolean(options && options.debug)
373
+ const override = Boolean(options && options.override)
374
+ const populated = {}
375
+
376
+ if (typeof parsed !== 'object') {
377
+ const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')
378
+ err.code = 'OBJECT_REQUIRED'
379
+ throw err
380
+ }
381
+
382
+ // Set process.env
383
+ for (const key of Object.keys(parsed)) {
384
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
385
+ if (override === true) {
386
+ processEnv[key] = parsed[key]
387
+ populated[key] = parsed[key]
388
+ }
389
+
390
+ if (debug) {
391
+ if (override === true) {
392
+ _debug(`"${key}" is already defined and WAS overwritten`)
393
+ } else {
394
+ _debug(`"${key}" is already defined and was NOT overwritten`)
395
+ }
396
+ }
397
+ } else {
398
+ processEnv[key] = parsed[key]
399
+ populated[key] = parsed[key]
400
+ }
401
+ }
402
+
403
+ return populated
404
+ }
405
+
406
+ const DotenvModule = {
407
+ configDotenv,
408
+ _configVault,
409
+ _parseVault,
410
+ config,
411
+ decrypt,
412
+ parse,
413
+ populate
414
+ }
415
+
416
+ module.exports.configDotenv = DotenvModule.configDotenv
417
+ module.exports._configVault = DotenvModule._configVault
418
+ module.exports._parseVault = DotenvModule._parseVault
419
+ module.exports.config = DotenvModule.config
420
+ module.exports.decrypt = DotenvModule.decrypt
421
+ module.exports.parse = DotenvModule.parse
422
+ module.exports.populate = DotenvModule.populate
423
+
424
+ module.exports = DotenvModule