How to use p-reduce - 3 common examples

To help you get started, we’ve selected a few p-reduce 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 semantic-release / semantic-release / test / helpers / git-utils.js View on Github external
export async function gitCommits(messages, execaOpts) {
  await pReduce(
    messages,
    async (_, message) =>
      (await execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)).stdout
  );
  return (await gitGetCommits(undefined, execaOpts)).slice(0, messages.length);
}
github semantic-release / git / test / helpers / git-utils.js View on Github external
export async function gitCommits(messages, execaOpts) {
  await pReduce(
    messages,
    async (_, message) =>
      (await execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)).stdout
  );
  return (await gitGetCommits(undefined, execaOpts)).slice(0, messages.length);
}
github shannonmoeller / ygor / packages / list / src / list.js View on Github external
function flatten(arr) {
	return reduce(arr, (a, b) => a.concat(b), []);
}

p-reduce

Reduce a list of values using promises into a promise for a value

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Popular p-reduce functions