@dotenvx/dotenvx 0.21.0 → 0.22.0

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/lib/main.js +10 -1
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.21.0",
2
+ "version": "0.22.0",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -32,7 +32,7 @@
32
32
  "clipboardy": "^2.3.0",
33
33
  "commander": "^11.1.0",
34
34
  "conf": "^10.2.0",
35
- "dotenv": "16.4.5",
35
+ "dotenv": "^16.4.5",
36
36
  "dotenv-expand": "^11.0.6",
37
37
  "execa": "^5.1.1",
38
38
  "glob": "^10.3.10",
package/src/lib/main.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const logger = require('./../shared/logger')
2
2
  const dotenv = require('dotenv')
3
+ const dotenvExpand = require('dotenv-expand')
3
4
 
4
5
  // services
5
6
  const Encrypt = require('./services/encrypt')
@@ -9,7 +10,15 @@ const Genexample = require('./services/genexample')
9
10
 
10
11
  // proxies to dotenv
11
12
  const config = function (options) {
12
- return dotenv.config(options)
13
+ const env = dotenv.config(options)
14
+
15
+ // if processEnv passed also pass to expand
16
+ if (options && options.processEnv) {
17
+ env.processEnv = options.processEnv
18
+ }
19
+ const expanded = dotenvExpand.expand(env)
20
+
21
+ return expanded
13
22
  }
14
23
 
15
24
  const configDotenv = function (options) {