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

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