function isFile(filePath) {

  // Resolve the path into an absolute path
  filePath = di.path.resolve(filePath);

  try {

    return di.fs.statSync(filePath).isFile();

  } catch (error) {

    return false;

  }

}
Check if a path represents a valid path for a file

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