How to use p-each-series - 7 common examples

To help you get started, we’ve selected a few p-each-series 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 algolia / talksearch / scripts / build / screenshots.js View on Github external
return path.basename(dirname);
    })
  );

  if (_.isEmpty(demos)) {
    return;
  }

  liveServer.start({
    root: './docs',
    open: false,
    port: 8082,
  });

  const browser = await puppeteer.launch();
  await pEach(demos, async demo => {
    const page = await browser.newPage();
    page.setViewport({ width: 1600, height: 900 });
    await page.goto(`http://127.0.0.1:8082/demos/${demo}/`);

    // Wait for the whole InstantSearch to load
    let waitForRender = true;
    while (waitForRender) {
      const renderDiv = await page.evaluate(() =>
        document.getElementById('firstRender')
      );
      waitForRender = !renderDiv;
    }

    const srcPath = `./src/demos/${demo}/og_image.png`;
    const docsPath = `./docs/demos/${demo}/og_image.png`;
    await page.screenshot({
github semantic-release / release-notes-generator / test / helpers / commits.js View on Github external
export default async function commits(messages) {
  const dir = tempy.directory();

  fs.symlink(path.resolve('./node_modules'), path.join(dir, 'node_modules'));
  process.chdir(dir);
  await fs.mkdir('git-templates');
  await execa('git', ['init', '--template=./git-templates']);

  await pEachSeries(messages, message => execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign']));
}
github SimenB / add-asset-html-webpack-plugin / src / addAllAssetsToCompilation.js View on Github external
export default async function(assets, compilation, htmlPluginData) {
  const handledAssets = await handleUrl(assets);
  await pEachSeries(handledAssets, asset =>
    addFileToAssets(compilation, htmlPluginData, asset),
  );
  return htmlPluginData;
}
github SimenB / add-asset-html-webpack-plugin / src / index.js View on Github external
async addAllAssetsToCompilation(compilation, htmlPluginData) {
    const handledAssets = await handleUrl(this.assets);
    await pEachSeries(handledAssets, asset =>
      this.addFileToAssets(compilation, htmlPluginData, asset),
    );
    return htmlPluginData;
  }
github u-wave / core / src / plugins / acl.js View on Github external
async maybeAddDefaultRoles() {
    const existingRoles = await this.AclRole.count();
    debug('existing roles', existingRoles);
    if (existingRoles === 0) {
      debug('no roles found, adding defaults');
      const roleNames = Object.keys(defaultRoles);
      await eachSeries(roleNames, roleName => this.createRole(roleName, defaultRoles[roleName]));
    }
  }
github algolia / docsearch / docs / scripts / lib / css.js View on Github external
async run() {
    const cssFiles = await helper.getFiles('style.css');

    await pEach(cssFiles, async filepath => {
      await this.compile(filepath);
    });
  },

p-each-series

Iterate over promises serially

MIT
Latest version published 4 years ago

Package Health Score

67 / 100
Full package analysis

Popular p-each-series functions