Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.03 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.03 KB

async-promised

Build Status

Native promise wrapper around caolan/async

It needs an ES6 environment to work (Promises, Block-scoped binding constructs, etc) like modern browsers and node 6.

Example:

const async = require('async-promised');
const sleep = require('sleep-promise');

await async.each([1, 3, 2], async x => {
  const ms = x * 25
  await sleep(ms)
  console.log(`I'm at element ${x}, and I waited ${ms}`)
});

Limitations

  • A promise can't be resolved with multiple values.
  • A promise can't be rejected with an Error and in the catch scope access the current results.
  • A promise can only resolve one time.

Missing utilities

  • cargo
  • queue
  • priorityQueue

Roadmap

  • Wrap the original async library with promise interface
  • Implement all the utilities and drop async dependency
  • Fix TypeScript typings
  • Fix docs