Uses

Uses

Import module

const Config = require("xtrmaddons-soft-suite-conf");

Examples of uses of the Config class

Get a property value

// Example of nested property value.
// { my: { var1: "my variable 1"}}
var prop = Config.get("my:var1");
// output : my variable 1

Set a property value

// Simple value.
Config.set("myVar1", myValue);

// Nested value.
Config.set("myVar1:prop", myValue);

// Set a property value with chaining.
Config.set("myVar2", myValue).set("myVar3", myValue);

Save configuration

Config.save(function() {
  console.log("calling callback");
});