Skip to content

v2.0.0

Compare
Choose a tag to compare
@jasisk jasisk released this 17 Mar 14:43
· 80 commits to 3.x since this release

Breaking Changes

  1. The import shortstop handler is now resolved after the merging of config.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 Request

    New 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
  2. Source priority, from highest to lowest (higher overrides lower), is now: command line arguments, environment variables, [env].json, config.json, convenience (environment normalization and env:* keys).
    previously: source priority order, from highest to lowest, was [env].json, config.json, convenience, environment variables, command line arguments.
    Implementation, Pull Request

    New 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" }