You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-14Lines changed: 30 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Manage JSON based configurations with AES encrypted secrets for multiple environ
12
12
13
13
Optional features:
14
14
-[HMAC validation](#hmacValidation) of configurations to ensure data integrity
15
-
- Setting of environment variables out of configuration items
15
+
- Setting of [environment variables](#envVarExports) out of configuration items
16
16
17
17
Works with CommonJS and ESM/ECMAScript. Ships with a [SBOM](#SBOM) to meet regulatory requirements.
18
18
@@ -243,13 +243,11 @@ Depending on the value of `NODE_ENV` the following configuration files will be l
243
243
Type: `Array`
244
244
Default: `[]`
245
245
246
-
With `envVarExports` you can set environment variables out of configuration items by passing an array of objects each having a `key` and `envVar` property where:
247
-
- `key` is the name of a configuration item
246
+
With the `envVarExports` option (or alternatively the `__envVarExports` configuration key) you can set environment variables out of configuration items by passing an array of objects each having a `key` and `envVar` property where:
247
+
- `key` is the name of a configuration item, if the configuration item is not at the top level of the configuration JSON, simply pass the full path to it using dotted notation (see example below)
248
248
- `envVar` is the name of the environment variable to be set with the value of the configuration item
249
249
- both properties must be of type string
250
250
251
-
If the configuration item is not at the top level of the configuration JSON, simply pass the full path to it using dotted notation (see example below).
252
-
253
251
Suppose you have the following configuation...
254
252
255
253
```json
@@ -262,7 +260,9 @@ Suppose you have the following configuation...
262
260
}
263
261
```
264
262
265
-
...and need to set the database user and password as environment variables `DB_USER` and `DB_PASSWORD`. Then simply pass the following `envVarExports` array.
263
+
...and need to set the database user and password as environment variables `DB_USER` and `DB_PASSWORD`. Then simply pass the following `envVarExports` array either programmatically or directly in the configuration via the `__envVarExports` key.
0 commit comments