How to use the globby.sync function in globby

To help you get started, we’ve selected a few globby examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elm-tooling / elm-language-server / src / elmWorkspace.ts View on Github external
private findElmFilesInFolder(element: [string, boolean]): IFolder[] {
    // Cleanup the path on windows, as globby does not like backslashes
    const globUri = element[0].replace(/\\/g, "/");

    return globby
      .sync(`${globUri}/**/*.elm`, { suppressErrors: true })
      .map(matchingPath => ({ path: matchingPath, writable: element[1] }));
  }
github gajus / canonical / src / utilities / bin / getTargetPaths.js View on Github external
paths = _.filter(paths, (pathName) => {
        const exclude = _.endsWith(pathName, '/') === true;

        if (exclude) {
            appendPaths.push(pathName + '**/*.js');
            appendPaths.push(pathName + '**/*.css');
            appendPaths.push(pathName + '**/*.scss');
        }

        return !exclude;
    });

    paths = paths.concat(appendPaths);
    paths = _.uniq(paths);

    paths = glob.sync(paths);
    // @todo Test whether glob.sync can return non-unique file paths.
    // paths = _.unique(paths);

    paths = _.map(paths, resolveAbsolutePath);

    return paths;
};
github angular / angular / aio / tools / stackblitz-builder / builder.js View on Github external
'!**/wallaby.js',
      '!**/karma-test-shim.js',
      '!**/karma.conf.js',
      '!**/test.ts',
      '!**/tsconfig.app.json',
      '!**/*stackblitz.*'
    ];

    // exclude all specs if no spec is mentioned in `files[]`
    if (!includeSpec) {
      defaultExcludes.push('!**/*.spec.*','!**/spec.js');
    }

    gpaths.push(...defaultExcludes);

    config.fileNames = globby.sync(gpaths, { ignore: ["**/node_modules/**"] });

    return config;
  }
}
github ampproject / amphtml / build-system / tasks / runtime-test / helpers-unit.js View on Github external
function getTestsFor(srcFiles) {
    const allUnitTests = globby.sync(unitTestPaths);
    return allUnitTests.filter(testFile => {
      return shouldRunTest(testFile, srcFiles);
    });
  }
github fusionjs / fusion-cli / get-test-files.js View on Github external
function getFiles() /*: Array */ {
  const allFiles = glob.sync(
    [
      '**/test.js',
      '**/*.spec.js',
      '**/*.test.js',
      ...testPathIgnorePatterns.map(pattern => `!${pattern}`),
    ],
    {gitignore: true}
  );

  const filesPerJob = Math.ceil(allFiles.length / JOB_COUNT);
  const startIndex = filesPerJob * JOB_INDEX;
  return allFiles.slice(startIndex, startIndex + filesPerJob);
}
github contao / contao-manager / gulpfile.js View on Github external
var globJsSource = function(javascripts) {
    var myScripts = javascripts || paths.javascripts.src;
    console.log(cwd, myScripts);
    myScripts = globby.sync(myScripts, {cwd: cwd});
    console.log(myScripts);

    return myScripts
};
github zeit / pkg / lib / walker.js View on Github external
function collect (ps) {
  return globby.sync(
    ps, { dot: true }
  );
}
github phenomic / phenomic / packages / core / src / watch / index.js View on Github external
function glob(path, patterns) {
  return globby.sync(patterns, { cwd: path }).map(file => toFile(path, file));
}
github qlik-oss / after-work.js / packages / utils / src / index.js View on Github external
packagesPath.forEach(root => {
    const { name } = importCwd(`./${root}/package.json`);
    const hasTests = globby.sync(`${root}/**/${testExt}`).length > 0;
    const testGlob = [`${root}/**/${testExt}`];
    const srcGlob = [`${root}/src/**/${srcExt}`];
    packagesMap.set(name, {
      root,
      hasTests,
      testGlob,
      srcGlob,
    });
  });
  return packagesMap;

globby

User-friendly glob matching

MIT
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis