function requireModule(urlOrPath) {
  return new Promise((resolve, reject) => {
    if (/^http/i.test(urlOrPath)) {
      resolve(cacheRemoteFile(urlOrPath));
    } else {
      resolve(urlOrPath);
    }
  }).then(localPath => loadLocalPath(localPath));
}
load a module from url or local path

@param {any} urlOrPath
@returns module