Sails.getConfiguration()

Retrieve the value of the specified Sails configuration setting.

Looks for the specified key (using dot notation) under the `sails.config` object. If the key does not exist, returns through the `noSuchConfig` exit.

Usage

Hover over inputs/exits for more info.

var Sails = require('machinepack-sails');


// Retrieve the value of the specified Sails configuration setting.

Sails.getConfiguration({

key: 'log.level',

expectedOutput: '===',

}).execSync();

Inputs

key required

The `sails.config` key to retrieve the value of.

'log.level'
expectedOutput

Optional example to use to determine the expected output type.

'==='

Exits

error

An unexpected error occurred.

noSuchConfig

The specified key could not be found in the `sails.config` object.

success

OK.

(varies based on provided inputs)