Lodash - global config

About

These functions manage a global shared object which is loaded from a JSON file on disk.

API

.clearConfig()

.clearConfig()

Clears any global config loaded by .loadConfig().


.config

.config : Object

Returns a shared object which contains any global config loaded by .loadConfig(). You may modify this object to access or change the global config, but be sure to wrap that code in Use/End use.

This property is read-only. To clear the global config, use .clearConfig().


.getConfigValue()

.getConfigValue(keyPath : Text) : any

Returns the config value specified by keyPath, which is a dotted path to a key starting from the top level of the config loaded by .loadConfig().

If no config has been loaded, or if the key path is not valid, undefined is returned.


.loadConfig()

.loadConfig(name : Text { ; merge : Boolean }) : Boolean

Loads an object into Storage from a JSON file with the name <name>.config.json. If name is not passed or is empty, it defaults to "4d".

First /RESOURCES/config/ (shared config) in the host DB is searched, then ~/.config/4d/ (local config).

Local config, if present, is merged with shared config. This allows machine-specific config to override shared config.

Last Updated:
Contributors: Aparajita