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

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