Config~Config()

The global configuration object for getting and setting configuration values.

new Config()

Members

static fileList

the path to the configuration file that was loaded, or null if none was loaded

static isLoaded

boolean indicating whether a configuration has been loaded

Methods

static get(key) → {*}

Gets the configuration value for the specified key

Parameters:
Name Type Description
key string

The name of the configuration value to retrieve

Returns:
* -

The configuration value

static getConfig() → {Map}

Returns a Map containing the global configuration values

Returns:
Map -

A map containing key / value pairs of configuration settings

async, static init()

Initializes the configuration, reading config files and such

static load(confObj)

Load a config using the specified Object as the key-value config settings

Parameters:
Name Type Description
confObj object

An Object where every key is a config parameter name and the associated value is the config value

static reset()

Reset all config values to their defaults and remove any non-default values

static set(key, val)

Sets the configuration value for the specified key

Parameters:
Name Type Description
key string

The name of the configuration value to assign

val *

The value to assign