Changelog
v3.1.0
q.pushAsync
and q.unshiftAsync
, analagous to q.push
and q.unshift
, except they always do not accept a callback, and reject if processing the task errors. (#1659)q.push
and q.unshift
when a callback is not passed now resolve even if an error ocurred. (#1659)autoInject
with complicated function bodies (#1663)Changelog
v3.0.1
queue
and cargo
would be completely flattened. (#1645)Changelog
v3.0.0
The async
/await
release!
There are a lot of new features and subtle breaking changes in this major version, but the biggest feature is that most Async methods return a Promise if you omit the callback, meaning you can await
them from within an async
function.
const results = await async.mapLimit(urls, 5, async url => {
const resp = await fetch(url)
return resp.body
})
await
-able! (#1572)queue
, priorityQueue
, cargo
and cargoQueue
, the "event"-style methods, like q.drain
and q.saturated
are now methods that register a callback, rather than properties you assign a callback to. They are now of the form q.drain(callback)
. If you do not pass a callback a Promise will be returned for the next occurrence of the event, making them await
-able, e.g. await q.drain()
. (#1586, #1641)callback(false)
will cancel an async method, preventing further iteration and callback calls. This is useful for preventing memory leaks when you break out of an async flow by calling an outer callback. (#1064, #1542)during
and doDuring
have been removed, and instead whilst
, doWhilst
, until
and doUntil
now have asynchronous test
functions. (#850, #1557)limits
of less than 1 now cause an error to be thrown in queues and collection methods. (#1249, #1552)memoize
no longer memoizes errors (#1465, #1466)applyEach
/applyEachSeries
have a simpler interface, to make them more easily type-able. It always returns a function that takes in a single callback argument. If that callback is omitted, a promise is returned, making it awaitable. (#1228, #1640)cargoQueue
, a queue with both concurrency
and payload
size parameters. (#1567)queue
now have a Symbol.iterator
method, meaning they can be iterated over to inspect the current list of items in the queue. (#1459, #1556)async.mjs
is included in the async
package. This is described in the package.json
"module"
field, meaning it should be automatically used by Webpack and other compatible bundlers.asyncify
(#1568, #1569)Changelog
v2.6.1
npm audit
warnings. (#1532, #1533)async-es
more optimized for webpack users (#1517)Changelog
v2.6.0
require('async/find')
or use async.anyLimit
. (#1483)queue
performance. (#1448, #1454)Changelog
v2.5.0
concatLimit
, the Limit
equivalent of concat
(#1426, #1430)concat
improvements: it now preserves order, handles falsy values and the iteratee
callback takes a variable number of arguments (#1437, #1436)queue
where there was a size discrepancy between workersList().length
and running()
(#1428, #1429)Changelog
v2.4.0
tryEach
, for running async functions in parallel, where you only expect one to succeed. (#1365, #687)parallel
and waterfall
(#1395)queue.remove()
, for removing items in a queue
(#1397, #1391)eval
, preventing Async from running in pages with Content Security Policy (#1404, #1403)asyncify
ed function's callback being caught by the underlying Promise (#1408)queue.empty()
(#1367)