chengkaiqiang e6b2cb2e99 DYZBC_20250121 1 mesiac pred
..
dist e6b2cb2e99 DYZBC_20250121 1 mesiac pred
internal e6b2cb2e99 DYZBC_20250121 1 mesiac pred
CHANGELOG.md e6b2cb2e99 DYZBC_20250121 1 mesiac pred
LICENSE e6b2cb2e99 DYZBC_20250121 1 mesiac pred
README.md e6b2cb2e99 DYZBC_20250121 1 mesiac pred
all.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
allLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
allSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
any.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
anyLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
anySeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
apply.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
applyEach.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
applyEachSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
asyncify.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
auto.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
autoInject.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
bower.json e6b2cb2e99 DYZBC_20250121 1 mesiac pred
cargo.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
cargoQueue.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
compose.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
concat.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
concatLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
concatSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
constant.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
detect.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
detectLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
detectSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
dir.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
doDuring.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
doUntil.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
doWhilst.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
during.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
each.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
eachLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
eachOf.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
eachOfLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
eachOfSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
eachSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
ensureAsync.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
every.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
everyLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
everySeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
filter.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
filterLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
filterSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
find.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
findLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
findSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
flatMap.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
flatMapLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
flatMapSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
foldl.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
foldr.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forEach.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forEachLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forEachOf.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forEachOfLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forEachOfSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forEachSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
forever.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
groupBy.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
groupByLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
groupBySeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
index.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
inject.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
log.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
map.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
mapLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
mapSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
mapValues.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
mapValuesLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
mapValuesSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
memoize.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
nextTick.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
package.json e6b2cb2e99 DYZBC_20250121 1 mesiac pred
parallel.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
parallelLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
priorityQueue.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
queue.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
race.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
reduce.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
reduceRight.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
reflect.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
reflectAll.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
reject.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
rejectLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
rejectSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
retry.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
retryable.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
select.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
selectLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
selectSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
seq.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
series.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
setImmediate.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
some.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
someLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
someSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
sortBy.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
timeout.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
times.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
timesLimit.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
timesSeries.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
transform.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
tryEach.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
unmemoize.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
until.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
waterfall.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
whilst.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred
wrapSync.js e6b2cb2e99 DYZBC_20250121 1 mesiac pred

README.md

Async Logo

Github Actions CI status NPM version Coverage Status jsDelivr Hits

Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use with Node.js and installable via npm i async, it can also be used directly in the browser. A ESM/MJS version is included in the main async package that should automatically be used with compatible bundlers such as Webpack and Rollup.

A pure ESM version of Async is available as async-es.

For Documentation, visit https://caolan.github.io/async/

For Async v1.5.x documentation, go HERE

// for use with Node-style callbacks...
var async = require("async");

var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
var configs = {};

async.forEachOf(obj, (value, key, callback) => {
    fs.readFile(__dirname + value, "utf8", (err, data) => {
        if (err) return callback(err);
        try {
            configs[key] = JSON.parse(data);
        } catch (e) {
            return callback(e);
        }
        callback();
    });
}, err => {
    if (err) console.error(err.message);
    // configs is now a map of JSON data
    doSomethingWith(configs);
});
var async = require("async");

// ...or ES2017 async functions
async.mapLimit(urls, 5, async function(url) {
    const response = await fetch(url)
    return response.body
}, (err, results) => {
    if (err) throw err
    // results is now an array of the response bodies
    console.log(results)
})