ConfigModule

config. ConfigModule

Module to expose config API

Constructor

new ConfigModule()

Source:

Extends

  • AbstractModule

Members

configFilePath :String

Source:
Path to the user configuration file
Type:
  • String

publicAttributes :Array.<String>

Source:
The keys for all attributes marked as public
Type:
  • Array.<String>

Methods

envVarToConfigKey(envVar) → {String}

Source:
Parses an environment variable key into a format expected by this module
Parameters:
Name Type Description
envVar String
Returns:
The formatted key
Type
String

get(attr) → {*}

Source:
Returns a value for a given attribute
Parameters:
Name Type Description
attr String Attribute key name
Returns:
The attribute's value
Type
*

getPublicConfig() → {Object}

Source:
Retrieves all config options marked as 'public'
Returns:
Type
Object

has(attr) → {Boolean}

Source:
Determines whether an attribute has a set value
Parameters:
Name Type Description
attr String Attribute key name
Returns:
Whether the value exists
Type
Boolean

(async) init()

Source:

(async) initRouter() → {Promise}

Source:
Adds routing functionality
Returns:
Type
Promise

(async) processModuleSchema(pkg, jsonschema) → {Promise}

Source:
Processes and validates a single module config schema (checks the user config specifies any required fields, and that they are the expected type)
Parameters:
Name Type Description
pkg Object Package.json data
jsonschema JsonSchemaModule Module instance for validation
Returns:
Type
Promise

set(attr, val)

Source:
Stores a value for the passed attribute
Parameters:
Name Type Description
attr String Attribute key name
val * Value to set

(async) storeEnvSettings() → {Promise}

Source:
Copy env values to config
Returns:
Type
Promise

(async) storeSchemaSettings() → {Promise}

Source:
Processes all module config schema files
Returns:
Type
Promise

(async) storeUserSettings() → {Promise}

Source:
Loads the relevant config file into memory
Returns:
Type
Promise