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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.3
    2
    • latest

Version History

Package Sidebar

Install

npm i apr-series

Weekly Downloads

2

Version

3.0.3

License

MIT

Last publish

Collaborators

  • ramitos