Skip to content

DanielRamosAcosta/async-promised

Repository files navigation

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

About

Async control flow patterns using promises based on https://github.com/caolan/async

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published