function loadYAML(filePath) {

  var file = loadFile(filePath, 'yml');

  // Parse the file
  try {

    return {
      json: di.yaml.load(file),
      raw: file.toString()
    };

  } catch (error) {

    throw new Error('The provided file is not a valid YAML file');

  }

}
Check, load, and parse YAML files

- Add .yml extension when needed

Throws
- The provided file doesn't exit
- The provided file is not a valid YAML file
- Any reading errors

@param  {String} filePath an absolute or a relative path
@return {Object}