function loadJSON(filePath) {

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

  // Read the file
  try {
    file = di.fs.readFileSync(filePath);
  } catch (error) {
    throw new Error(error);
  }

  // Parse the file
  try {
    return JSON.parse(file);
  } catch (error) {
    throw new Error('The provided file is not a valid JSON file');
  }

}
Check, load, and parse JSON files

- Add .json extension when needed

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

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