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

README.md

Async Logo

Build Status via Travis CI NPM version Coverage Status libhive - Open source examples 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 install --save async, it can also be used directly in the browser.

This version of the package is optimized for the Node.js environment. If you use Async with webpack, install async-es instead.

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