Creates a new instance of config reader.
(optional) component configuration parameters
Adds a listener that will be notified when configuration is changed
a listener to be added.
Configures component by passing configuration parameters.
configuration parameters to be set.
Reads configuration and parameterize it with given values.
(optional) transaction id to trace execution through call chain.
values to parameters the configuration or null to skip parameterization.
callback function that receives configuration or error.
Remove a previously added change listener.
a listener to be removed.
Generated using TypeDoc
Config reader that stores configuration in memory.
The reader supports parameterization using Handlebars template engine: https://handlebarsjs.com
Configuration parameters
The configuration parameters are the configuration template
IConfigReader
Example
let config = ConfigParams.fromTuples( "connection.host", "{{SERVICE_HOST}}", "connection.port", "{{SERVICE_PORT}}{{^SERVICE_PORT}}8080{{/SERVICE_PORT}}" ); let configReader = new MemoryConfigReader(); configReader.configure(config); let parameters = ConfigParams.fromValue(process.env); configReader.readConfig("123", parameters, (err, config) => { // Possible result: connection.host=10.1.1.100;connection.port=8080 });