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
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,16 @@ var config = getenv.multi({
98
98
99
99
```
100
100
101
+
### env.url(name, [fallback])
102
+
103
+
Return a parsed URL as per Node's `require("url").parse`. N.B `url` doesn't validate URLs, so be sure it includes a protocol or you'll get deeply weird results.
104
+
105
+
```javascript
106
+
var serviceUrl =getenv.url('SERVICE_URL');
107
+
108
+
serviceUrl.port; // parsed port number
109
+
```
110
+
101
111
### env.disableFallbacks()
102
112
103
113
Disallows fallbacks in environments where you don't want to rely on brittle development defaults (e.g production, integration testing). For example, to disable fallbacks if we indicate production via `NODE_ENV`:
@@ -110,6 +120,9 @@ if (process.env.NODE_ENV === 'production') {
110
120
111
121
## Changelog
112
122
123
+
### v0.5.0
124
+
- Add getenv.url() support.
125
+
113
126
### v0.4.0
114
127
- Add getenv.disableFallbacks() support.
115
128
@@ -128,7 +141,7 @@ if (process.env.NODE_ENV === 'production') {
0 commit comments