async function findAllJsFiles(pathToScan, excludedGlobs) {
  if (globMatch(excludedGlobs, pathToScan)) {
    return [];
  }

  const stats = await fs.stat(pathToScan);

  if (stats.isDirectory()) {
    let allfiles = [];
    const files = await fs.readdir(pathToScan);
    const allFilePromises = files.map(
        file => findAllJsFiles(path.join(pathToScan, file), excludedGlobs));
    for (const p of allFilePromises) {
      const subFiles = await p;
      allfiles = allfiles.concat(subFiles);
    }
    return allfiles;
  } else if (stats.isFile()) {
    if (pathToScan.endsWith('.js')) {
      return [pathToScan];
    }
  }

  return [];
}
@param {string} pathToScan
@param {!Array<string>} excludedGlobs
@return {!Promise<!Array<string>>}