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

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