cla/config - Using configuration variables

In Clarive config you will be able to load configuration variables to be used in Clarive.

config.get(key)

Get option will load the configuration variable or variables into a hash structure. It will load the configuration variables from the key you specify in it.

var config = require("cla/config");

// This will get the config.test. It can contain just one variable or more.
var config_test = config.get("config.test");

// This will get the value of config.test.variableOne.
var variableOne = config_test.variableOne;

config.getValue(key)

This method will return the value assigned to key from the current config config.yml values, using the current user environment.

var config = require("cla/config");
console.log( config.getValue('pubsub').port );

This method does not support json pointers (dots in the key name), ie. config.getValue('mykey.subkey'). Get the parent key instead then extract the subvalue, config.getValue('mykey').subkey.