Skip to content

Commit cea5861

Browse files
committed
update README for getenv.multi()
1 parent 5acb20a commit cea5861

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@ Return as boolean.
8484

8585
Split value of the environment variable at each comma and return the resulting array where each value has been typecast according to the `type` parameter. An array can be provided as `fallback`.
8686

87+
### env.multi({spec})
88+
89+
Return a list of environment variables based on a `spec`:
90+
91+
```javascript
92+
var config = getenv.multi({
93+
foo: "FOO", // throws if FOO doesn't exist
94+
bar: ["BAR", "defaultval"], // set a default value
95+
baz: ["BAZ", "defaultval", "string"], // parse into type
96+
quux: ["QUUX", undefined, "integer"] // parse & throw
97+
});
98+
99+
```
100+
87101
## Changelog
88102

89103
### v0.2.0

0 commit comments

Comments
 (0)