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

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