wild-config
Advanced tools
Comparing version 1.3.6 to 1.4.0
@@ -24,3 +24,3 @@ /* eslint no-console: 0, global-require: 0 */ | ||
const argv = require('minimist')(process.argv.slice(2)); | ||
const configPath = argv.config || argv.c || false; | ||
const configPath = process.env.NODE_CONFIG_PATH || argv.config || false; | ||
@@ -203,3 +203,2 @@ events.setMaxListeners(0); | ||
delete argv.config; | ||
delete argv.c; | ||
@@ -206,0 +205,0 @@ let walkConfig = (cParent, eParent) => { |
{ | ||
"name": "wild-config", | ||
"version": "1.3.6", | ||
"version": "1.4.0", | ||
"description": "Configuration management module", | ||
@@ -13,3 +13,5 @@ "main": "index.js", | ||
}, | ||
"keywords": ["config"], | ||
"keywords": [ | ||
"config" | ||
], | ||
"author": "Andris Reinman", | ||
@@ -22,13 +24,14 @@ "license": "MIT", | ||
"dependencies": { | ||
"deep-extend": "^0.5.0", | ||
"glob": "^7.1.2", | ||
"deep-extend": "^0.6.0", | ||
"eslint-config-prettier": "^3.6.0", | ||
"glob": "^7.1.3", | ||
"minimist": "^1.2.0", | ||
"toml": "^2.3.3" | ||
"toml": "^2.3.5" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-nodemailer": "^1.2.0", | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-eslint": "^20.1.0" | ||
"grunt": "^1.0.3", | ||
"grunt-cli": "^1.3.2", | ||
"grunt-eslint": "^21.0.0" | ||
} | ||
} |
@@ -5,8 +5,8 @@ # wild-config | ||
- Config files use either [toml](https://github.com/toml-lang/toml), JSON or JavaScript syntax | ||
- If the config file format is JavaScript, then the value must be exported with "module.exports = {...}" | ||
- The application can have a config file for default values in ./config/default.toml | ||
- Main config file path can be provided from a command line argument, eg. `--config=/etc/app.toml` | ||
- Additionally command line arguments can be used to override any existing config option | ||
- _wild-config_ detects SIGHUP and reloads configuration files automatically | ||
- Config files use either [toml](https://github.com/toml-lang/toml), JSON or JavaScript syntax | ||
- If the config file format is JavaScript, then the value must be exported with "module.exports = {...}" | ||
- The application can have a config file for default values in ./config/default.toml | ||
- Main config file path can be provided from a command line argument, eg. `--config=/etc/app.toml` | ||
- Additionally command line arguments can be used to override any existing config option | ||
- _wild-config_ detects SIGHUP and reloads configuration files automatically | ||
@@ -17,5 +17,5 @@ ## Loading order | ||
1. ./config/default.* | ||
2. ./config/$NODE_ENV.* | ||
3. `--config` or `-c` argument value | ||
1. ./config/default.\* | ||
2. ./config/\$NODE_ENV.\* | ||
3. `NODE_CONFIG_PATH` environment value or `--config` argument value | ||
4. command line arguments | ||
@@ -72,7 +72,7 @@ | ||
- Included paths are resolved relative to the path of the configuration file where the include directive is used | ||
- Included config files do not have to be toml files, any other supported format works as well | ||
- If the included config file is a toml file then it can have its own includes | ||
- If the config file returns an array then the array value will become the value of the parent key of the directive only if there are no other subkeys at the same level as the directive | ||
- Special value `{ENV}` is replaced in all file paths by the NODE_ENV value | ||
- Included paths are resolved relative to the path of the configuration file where the include directive is used | ||
- Included config files do not have to be toml files, any other supported format works as well | ||
- If the included config file is a toml file then it can have its own includes | ||
- If the config file returns an array then the array value will become the value of the parent key of the directive only if there are no other subkeys at the same level as the directive | ||
- Special value `{ENV}` is replaced in all file paths by the NODE_ENV value | ||
@@ -102,3 +102,3 @@ ## Application config file | ||
const config = require('wild-config'); | ||
config.on('reload', ()=>{ | ||
config.on('reload', () => { | ||
console.log('New "server.enabled" value: %s', config.server.enabled); | ||
@@ -110,8 +110,8 @@ }); | ||
- _'reload'_ emitted when SIGHUP is received and configuration is reloaded | ||
- _'reload'_ emitted when SIGHUP is received and configuration is reloaded | ||
### Limitations | ||
- You can not use "on" as a root key. If you do then it is ignored. This key is reserved for the event emitter handler. | ||
- When providing configuration options from command line then `--config` does not override `root.config` value (if it even exists). This argument is used only for defining the configuration file path. | ||
- You can not use "on" as a root key. If you do then it is ignored. This key is reserved for the event emitter handler. | ||
- When providing configuration options from command line then `--config` does not override `root.config` value (if it even exists). This argument is used only for defining the configuration file path. | ||
@@ -118,0 +118,0 @@ ## Licese |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15566
16
279
5
7
+ Added@eslint-community/eslint-utils@4.4.1(transitive)
+ Added@eslint-community/regexpp@4.12.1(transitive)
+ Added@eslint/config-array@0.19.0(transitive)
+ Added@eslint/core@0.9.0(transitive)
+ Added@eslint/eslintrc@3.2.0(transitive)
+ Added@eslint/js@9.15.0(transitive)
+ Added@eslint/object-schema@2.1.4(transitive)
+ Added@eslint/plugin-kit@0.2.3(transitive)
+ Added@humanfs/core@0.19.1(transitive)
+ Added@humanfs/node@0.16.6(transitive)
+ Added@humanwhocodes/module-importer@1.0.1(transitive)
+ Added@humanwhocodes/retry@0.3.10.4.1(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Added@types/json-schema@7.0.15(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedacorn-jsx@5.3.2(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedeslint@9.15.0(transitive)
+ Addedeslint-config-prettier@3.6.0(transitive)
+ Addedeslint-scope@8.2.0(transitive)
+ Addedeslint-visitor-keys@3.4.34.2.0(transitive)
+ Addedespree@10.3.0(transitive)
+ Addedesquery@1.6.0(transitive)
+ Addedesrecurse@4.3.0(transitive)
+ Addedestraverse@5.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfile-entry-cache@8.0.0(transitive)
+ Addedfind-up@5.0.0(transitive)
+ Addedflat-cache@4.0.1(transitive)
+ Addedflatted@3.3.2(transitive)
+ Addedget-stdin@6.0.0(transitive)
+ Addedglob-parent@6.0.2(transitive)
+ Addedglobals@14.0.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjs-yaml@4.1.0(transitive)
+ Addedjson-buffer@3.0.1(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stable-stringify-without-jsonify@1.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
+ Addedlevn@0.4.1(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedlodash.merge@4.6.2(transitive)
+ Addedms@2.1.3(transitive)
+ Addednatural-compare@1.4.0(transitive)
+ Addedoptionator@0.9.4(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedprelude-ls@1.2.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtype-check@0.4.0(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removeddeep-extend@0.5.1(transitive)
Updateddeep-extend@^0.6.0
Updatedglob@^7.1.3
Updatedtoml@^2.3.5