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

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