Neutralize Pesky Miscreants
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

apr-series

3.0.3 • Public • Published

series

Run the functions in the tasks in series, each one running once the previous function has completed.

Parameters

Examples

import series from 'apr-series';
 
const then = (v) => new Promise((resolve) => resolve(v));
 
const withArray = await series([
  async () => await then(1),
  async () => await then(2)
]);
 
// withArray = [1, 2]
 
const withObject = await series({
  one: async () => await then(1),
  two: async () => await then(2)
});
 
// withObject = { one: 1, two: 2 }

Returns Promise

install

npm i apr-series

Downloadsweekly downloads

2

version

3.0.3

license

MIT

homepage

apr.js.org

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability