Creates a new instance of the config reader.
(optional) a path to configuration file.
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.
Get the path to configuration file..
the path to configuration file.
Parameterized configuration template given as string with dynamic parameters.
The method uses Handlebars template engine.
a string with configuration template to be parameterized
dynamic parameters to inject into the template
a parameterized configuration string.
Reads configuration and parameterize it with given values.
(optional) transaction id to trace execution through call chain.
values to parameters the configuration
callback function that receives configuration or error.
Reads configuration file, parameterizes its content and converts it into JSON object.
(optional) transaction id to trace execution through call chain.
values to parameters the configuration.
a JSON object with configuration.
Remove a previously added change listener.
a listener to be removed.
Set the path to configuration file.
a new path to configuration file.
Reads configuration from a file, parameterize it with given values and returns a new ConfigParams object.
(optional) transaction id to trace execution through call chain.
values to parameters the configuration.
Reads configuration file, parameterizes its content and converts it into JSON object.
(optional) transaction id to trace execution through call chain.
values to parameters the configuration.
a JSON object with configuration.
Generated using TypeDoc
Config reader that reads configuration from JSON file.
The reader supports parameterization using Handlebar template engine.
Configuration parameters
IConfigReader
FileConfigReader
Example
======== config.json ====== { "key1": "{{KEY1_VALUE}}", "key2": "{{KEY2_VALUE}}" } =========================== let configReader = new JsonConfigReader("config.json"); let parameters = ConfigParams.fromTuples("KEY1_VALUE", 123, "KEY2_VALUE", "ABC"); configReader.readConfig("123", parameters, (err, config) => { // Result: key1=123;key2=ABC });