v2.0.0
Breaking Changes
-
The
import
shortstop handler is now resolved after the merging ofconfig.json
,[env].json
, and before the other shortstop handlers are resolved.
previously:import
handler resolved only once, before the rest of the shortstop handlers.
implementation 1, implementation 2, Issue, Pull RequestNew Behavior:
{ "main": "import:main.json" } // config/config.json { "key": "value", "otherKey": "otherValue" } // config/main.json { "main": { "key": "devValue" } } // config/dev.json { "main": { "key": "devValue", "otherKey": "otherValue" } } // result
-
Source priority, from highest to lowest (higher overrides lower), is now: command line arguments, environment variables,
[env].json
,config.json
, convenience (environment normalization andenv:*
keys).
previously: source priority order, from highest to lowest, was[env].json
,config.json
, convenience, environment variables, command line arguments.
Implementation, Pull RequestNew Behavior:
// config/config.json { "KEY": "fromConfig", "OTHER_KEY": "fromConfig", "THIRD_KEY": "fromConfig" }
OTHER_KEY=fromEnv THIRD_KEY=fromEnv node myApp.js --THIRD_KEY=fromArgv
// result { "KEY": "fromConfig", "OTHER_KEY": "fromEnv", "THIRD_KEY": "fromArgv" }