config 4.3.0 → 4.4.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.
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  Configure your Node.js Applications
2
2
  ===================================
3
3
 
4
- [![NPM](https://nodei.co/npm/config.svg?downloads=true&downloadRank=true)](https://nodei.co/npm/config/)  
5
- [![Build Status](https://secure.travis-ci.org/node-config/node-config.svg?branch=master)](https://travis-ci.org/lorenwest/node-config)  
6
- [release notes](https://github.com/node-config/node-config/blob/master/History.md)
4
+ [![npm package](https://img.shields.io/npm/v/config)](https://www.npmjs.com/package/config)
5
+ [![Downloads](https://img.shields.io/npm/dt/config)](https://www.npmjs.com/package/config)
6
+ [![Issues](https://img.shields.io/github/issues/node-config/node-config)](https://github.com/node-config/node-config/issues)
7
+
8
+ [Release Notes](https://github.com/node-config/node-config/releases)
7
9
 
8
10
  Introduction
9
11
  ------------
@@ -105,6 +107,11 @@ Running in this configuration, the `port` and `dbName` elements of `dbConfig`
105
107
  will come from the `default.json` file, and the `host` element will
106
108
  come from the `production.json` override file.
107
109
 
110
+ TypeScript
111
+ ----------
112
+
113
+ Type declarations are published under `types/` and resolved via `typesVersions`. Subpath typings are included for `config/async`, `config/defer`, `config/parser`, `config/raw`, and `config/lib/util` in addition to the main `config` entrypoint.
114
+
108
115
  Articles
109
116
  --------
110
117
 
@@ -135,35 +142,35 @@ If you still don't see what you are looking for, here are some more resources to
135
142
  Contributors
136
143
  ------------
137
144
  <table id="contributors"><tr><td><img src=https://avatars.githubusercontent.com/u/373538?v=4><a href="https://github.com/lorenwest">lorenwest</a></td>
138
- <td><img src=https://avatars.githubusercontent.com/u/25829?v=4><a href="https://github.com/markstos">markstos</a></td>
139
145
  <td><img src=https://avatars.githubusercontent.com/u/1656505?v=4><a href="https://github.com/jdmarshall">jdmarshall</a></td>
146
+ <td><img src=https://avatars.githubusercontent.com/u/25829?v=4><a href="https://github.com/markstos">markstos</a></td>
140
147
  <td><img src=https://avatars.githubusercontent.com/u/1083065?v=4><a href="https://github.com/iMoses">i&shy;Moses</a></td>
141
148
  <td><img src=https://avatars.githubusercontent.com/u/447151?v=4><a href="https://github.com/elliotttf">elliotttf</a></td>
142
- <td><img src=https://avatars.githubusercontent.com/u/8839447?v=4><a href="https://github.com/jfelege">jfelege</a></td>
143
- </tr><tr><td><img src=https://avatars.githubusercontent.com/u/66902?v=4><a href="https://github.com/leachiM2k">leachi&shy;M2k</a></td>
144
- <td><img src=https://avatars.githubusercontent.com/u/133277?v=4><a href="https://github.com/enyo">enyo</a></td>
149
+ <td><img src=https://avatars.githubusercontent.com/u/11448209?v=4><a href="https://github.com/mdkitzman">mdkitzman</a></td>
150
+ </tr><tr><td><img src=https://avatars.githubusercontent.com/u/8839447?v=4><a href="https://github.com/jfelege">jfelege</a></td>
151
+ <td><img src=https://avatars.githubusercontent.com/u/66902?v=4><a href="https://github.com/leachiM2k">leachi&shy;M2k</a></td>
145
152
  <td><img src=https://avatars.githubusercontent.com/u/791137?v=4><a href="https://github.com/josx">josx</a></td>
153
+ <td><img src=https://avatars.githubusercontent.com/u/133277?v=4><a href="https://github.com/enyo">enyo</a></td>
146
154
  <td><img src=https://avatars.githubusercontent.com/u/4307697?v=4><a href="https://github.com/leosuncin">leosuncin</a></td>
147
155
  <td><img src=https://avatars.githubusercontent.com/u/1077378?v=4><a href="https://github.com/arthanzel">arthanzel</a></td>
148
- <td><img src=https://avatars.githubusercontent.com/u/8650543?v=4><a href="https://github.com/leonardovillela">leonardovillela</a></td>
149
- </tr><tr><td><img src=https://avatars.githubusercontent.com/u/77355440?v=4><a href="https://github.com/jeremy-daley-kr">jeremy-daley-kr</a></td>
156
+ </tr><tr><td><img src=https://avatars.githubusercontent.com/u/8650543?v=4><a href="https://github.com/leonardovillela">leonardovillela</a></td>
157
+ <td><img src=https://avatars.githubusercontent.com/u/77355440?v=4><a href="https://github.com/jeremy-daley-kr">jeremy-daley-kr</a></td>
150
158
  <td><img src=https://avatars.githubusercontent.com/u/2529835?v=4><a href="https://github.com/simon-scherzinger">simon-scherzinger</a></td>
151
159
  <td><img src=https://avatars.githubusercontent.com/u/5138570?v=4><a href="https://github.com/BadgerBadgerBadgerBadger">Badger&shy;Badger&shy;Badger&shy;Badger</a></td>
152
160
  <td><img src=https://avatars.githubusercontent.com/u/842998?v=4><a href="https://github.com/nsabovic">nsabovic</a></td>
153
161
  <td><img src=https://avatars.githubusercontent.com/u/1751645?v=4><a href="https://github.com/cunneen">cunneen</a></td>
154
- <td><img src=https://avatars.githubusercontent.com/u/506460?v=4><a href="https://github.com/Osterjour">Osterjour</a></td>
155
- </tr><tr><td><img src=https://avatars.githubusercontent.com/u/138707?v=4><a href="https://github.com/th507">th507</a></td>
156
- <td><img src=https://avatars.githubusercontent.com/u/86159966?v=4><a href="https://github.com/DeutscherDude">Deutscher&shy;Dude</a></td>
162
+ </tr><tr><td><img src=https://avatars.githubusercontent.com/u/506460?v=4><a href="https://github.com/Osterjour">Osterjour</a></td>
163
+ <td><img src=https://avatars.githubusercontent.com/u/138707?v=4><a href="https://github.com/th507">th507</a></td>
164
+ <td><img src=https://avatars.githubusercontent.com/u/242058858?v=4><a href="https://github.com/tiny-rac00n">tiny-rac00n</a></td>
157
165
  <td><img src=https://avatars.githubusercontent.com/u/1656140?v=4><a href="https://github.com/eheikes">eheikes</a></td>
158
166
  <td><img src=https://avatars.githubusercontent.com/u/1872824?v=4><a href="https://github.com/fgheorghe">fgheorghe</a></td>
159
167
  <td><img src=https://avatars.githubusercontent.com/u/498929?v=4><a href="https://github.com/roncli">roncli</a></td>
160
- <td><img src=https://avatars.githubusercontent.com/u/1355559?v=4><a href="https://github.com/superoven">superoven</a></td>
161
- </tr><tr><td><img src=https://avatars.githubusercontent.com/u/631249?v=4><a href="https://github.com/airdrummingfool">airdrummingfool</a></td>
168
+ </tr><tr><td><img src=https://avatars.githubusercontent.com/u/1355559?v=4><a href="https://github.com/superoven">superoven</a></td>
169
+ <td><img src=https://avatars.githubusercontent.com/u/631249?v=4><a href="https://github.com/airdrummingfool">airdrummingfool</a></td>
162
170
  <td><img src=https://avatars.githubusercontent.com/u/54934?v=4><a href="https://github.com/wmertens">wmertens</a></td>
163
171
  <td><img src=https://avatars.githubusercontent.com/u/2842176?v=4><a href="https://github.com/XadillaX">Xadilla&shy;X</a></td>
164
172
  <td><img src=https://avatars.githubusercontent.com/u/107884?v=4><a href="https://github.com/inside">inside</a></td>
165
173
  <td><img src=https://avatars.githubusercontent.com/u/1320090?v=4><a href="https://github.com/dsbert">dsbert</a></td>
166
- <td><img src=https://avatars.githubusercontent.com/u/527814?v=4><a href="https://github.com/jacobemerick">jacobemerick</a></td>
167
174
  </tr></table>
168
175
 
169
176
  License
@@ -173,4 +180,3 @@ May be freely distributed under the [MIT license](https://raw.githubusercontent.
173
180
 
174
181
  Copyright (c) 2010-2026 Loren West
175
182
  [and other contributors](https://github.com/node-config/node-config/graphs/contributors)
176
-
package/async.js CHANGED
@@ -1,10 +1,27 @@
1
1
  const asyncSymbol = Symbol('asyncSymbol');
2
2
  const { deferConfig } = require('./defer');
3
3
 
4
+ /** @typedef {import('./lib/config').Config} Config */
5
+ /** @typedef {import('./defer').DeferredConfig} DeferredConfig */
6
+
7
+ /**
8
+ * @template T
9
+ * @overload
10
+ * @param {Promise<T>} promiseOrFunc
11
+ * @returns {Promise<T>}
12
+ */
13
+ /**
14
+ * @template T
15
+ * @overload
16
+ * @param {(config: Config, original: any) => Promise<T>} promiseOrFunc
17
+ * @returns {DeferredConfig}
18
+ */
4
19
  /**
5
- * @param promiseOrFunc the promise will determine a property's value once resolved
20
+ * @template T
21
+ * @param {Promise<T> | ((config: Config, original: any) => Promise<T>)} promiseOrFunc
22
+ * the promise will determine a property's value once resolved
6
23
  * can also be a function to defer which resolves to a promise
7
- * @returns {Promise} a marked promise to be resolve later using `resolveAsyncConfigs`
24
+ * @returns {Promise<T> | DeferredConfig} a marked promise to be resolve later using `resolveAsyncConfigs`
8
25
  * @deprecated please use async functions with defer
9
26
  */
10
27
  function asyncConfig(promiseOrFunc) {
@@ -37,9 +54,9 @@ function asyncConfig(promiseOrFunc) {
37
54
  }
38
55
 
39
56
  /**
40
- * Do not use `config.get` before executing this method, it will freeze the config object
41
- * @param config the main config object, returned from require('config')
42
- * @returns {Promise<config>} once all promises are resolved, return the original config object
57
+ * Do not use `config.get` before executing this method, it will freeze the config object.
58
+ * @param {Config} config the main config object, returned from require('config')
59
+ * @returns {Promise<Config>} once all promises are resolved, return the original config object
43
60
  * @deprecated please use async functions with defer and Util.resolveAsyncConfigs
44
61
  */
45
62
  function resolveAsyncConfigs(config) {
package/defer.js CHANGED
@@ -3,6 +3,7 @@ const { deferConfig, DeferredConfig } = require('./lib/defer.js');
3
3
  /**
4
4
  * @deprecated please use the new callback mechanism
5
5
  * @see lib/defer.js
6
+ * @type {typeof import('./lib/defer').deferConfig}
6
7
  */
7
8
  module.exports.deferConfig = (...args) => {
8
9
  const { Util } = require('./lib/util.js');
@@ -13,5 +14,6 @@ module.exports.deferConfig = (...args) => {
13
14
 
14
15
  /**
15
16
  * @deprecated please use the new callback mechanism
17
+ * @type {typeof import('./lib/defer').DeferredConfig}
16
18
  */
17
19
  module.exports.DeferredConfig = DeferredConfig;