How to use the glob-promise.sync function in glob-promise

To help you get started, we’ve selected a few glob-promise 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 chrisathook / display-standard-previewer / gulp / test-definitions.js View on Github external
it('no SVG IDs should be duplicates must be GLOBAL UNIQUE ', function () {
    let files = glob.sync(src);
    files.forEach(function (file) {
      
      // inventory of all styles in each file
      let inventory = {};
      inventory.file = file;
      let content = fs.readFileSync(file, 'utf8');
      let matches = [];
      try {
        
        matches = content.match(/id\=\"(.*?)\"/g);
      } catch (err) {
      }
      let trimmed = [];
      matches.forEach(function (match) {
        trimmed.push(match.replace('.', '').replace('{', ''))
      });
github epsagon / serverless-plugin-epsagon / src / index.js View on Github external
await Promise.all(this.funcs.map(async (func) => {
      const handler = _.isString(func.handler) ? func.handler.split('.') : [];
      const relativePath = handler.slice(0, -1).join('.');
      const matchingFiles = glob.sync(`${relativePath}.*`);
      if (
        matchingFiles.length > 0 &&
           (matchingFiles[0].endsWith('.ts') ||
            matchingFiles[0].endsWith('.tsx'))
      ) {
        // This is a good enough test for now. lets treat it as TS.
        func.language = 'tsnode'; // eslint-disable-line no-param-reassign
      }
    }));
  }
github highlightjs / highlight.js / tools / build_browser.js View on Github external
function installDemoStyles() {
  log("Writing style files.");
  mkdir("demo/styles");

  glob.sync("*", {cwd: "./src/styles"}).forEach((file) => {
    if (file.endsWith(".css"))
      install_cleancss(`./src/styles/${file}`,`demo/styles/${file}`);
    else // images, backgrounds, etc
      install(`./src/styles/${file}`,`demo/styles/${file}`);
  })
}

glob-promise

Promise version of glob

MIT
Latest version published 8 months ago

Package Health Score

71 / 100
Full package analysis