lib/file/yaml/get.js
function yamlFileGet(file, keyPath, options) {
  if (_.isPlainObject(keyPath) && arguments.length === 2) {
    options = keyPath;
    keyPath = undefined;
  }
  options = _.sanitize(options, {encoding: 'utf-8', default: ''});
  const content = yaml.safeLoad(read(file, _.pick(options, 'encoding')));
  const value = _extractValue(content, keyPath);
  return _.isUndefined(value) ? options.default : value;
}
function yamlFileGet(file, keyPath, options) {
  if (_.isPlainObject(keyPath) && arguments.length === 2) {
    options = keyPath;
    keyPath = undefined;
  }
  options = _.sanitize(options, {encoding: 'utf-8', default: ''});
  const content = yaml.safeLoad(read(file, _.pick(options, 'encoding')));
  const value = _extractValue(content, keyPath);
  return _.isUndefined(value) ? options.default : value;
}
function yamlFileGet ( file , keyPath , options ) { if ( _ . isPlainObject ( keyPath ) && arguments . length === 2 ) { options = keyPath ; keyPath = undefined ; } options = _ . sanitize ( options , { encoding : 'utf-8' , default : '' } ) ; const content = yaml . safeLoad ( read ( file , _ . pick ( options , 'encoding' ) ) ) ; const value = _extractValue ( content , keyPath ) ; return _ . isUndefined ( value ) ? options . default : value ; }
Get value from .yaml file

@function $file~yaml/get
@param {string} file - Yaml File to read the value from
@param {string} keyPath to read (it can read nested keys: `'outerKey/innerKey'` or `'/outerKey/innerKey'`. `null`
or `'/'` will match all the document). Alternative format: ['outerKey', 'innerKey'].
@param {Object} [options]
@param {string} [options.encoding=utf-8] - Encoding used to read the file
@param {string} [options.default=''] - Default value if key not found
@returns {string|Number|boolean|Array|Object} Returns the field extracted from the yaml or the default value
@throws Will throw an error if the path is not a file
Get value from . yaml file