Skip to content
axios edited this page Sep 21, 2021 · 2 revisions

Get details from the code.

Usage

const { Configuration } = require('@axiosleo/cli-tool');

const config = new Configuration({ a: 'A', b: 'B'});

// assign
config.assign({
  c: 'C',
  x: {
    y: {
      z: 'Z'
    }
  }
});

// get
config.get('x.y.z', '<default-value>'); // return default value if the value not exist.

// validate
config.validate('x.y.z');     // single validate
config.validate([ 'x.y.z' ]); // multi validate

// init config
config.init({
  a: 'new value A',
  b: 'new value B'
});
Clone this wiki locally