index.js
function tryRequire(filePath) {
  let resolvedPath = req.resolve(filePath);

  if (resolvedPath) {
    return req(resolvedPath);
  }

  return undefined;
}
function tryRequire(filePath) {
  let resolvedPath = req.resolve(filePath);

  if (resolvedPath) {
    return req(resolvedPath);
  }

  return undefined;
}
function tryRequire ( filePath ) { let resolvedPath = req . resolve ( filePath ) ; if ( resolvedPath ) { return req ( resolvedPath ) ; } return undefined ; }
Try to require a module, do not fail if module is missing
@param {string} filePath
@returns {module}
@throw if fails for reason other than missing module
Try to require a module do not fail if module is missing