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

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