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

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. An 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)
})