You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michael Winter 555e2c196e initial commit 5 years ago
..
dist initial commit 5 years ago
internal initial commit 5 years ago
CHANGELOG.md initial commit 5 years ago
LICENSE initial commit 5 years ago
README.md initial commit 5 years ago
all.js initial commit 5 years ago
allLimit.js initial commit 5 years ago
allSeries.js initial commit 5 years ago
any.js initial commit 5 years ago
anyLimit.js initial commit 5 years ago
anySeries.js initial commit 5 years ago
apply.js initial commit 5 years ago
applyEach.js initial commit 5 years ago
applyEachSeries.js initial commit 5 years ago
asyncify.js initial commit 5 years ago
auto.js initial commit 5 years ago
autoInject.js initial commit 5 years ago
bower.json initial commit 5 years ago
cargo.js initial commit 5 years ago
cargoQueue.js initial commit 5 years ago
compose.js initial commit 5 years ago
concat.js initial commit 5 years ago
concatLimit.js initial commit 5 years ago
concatSeries.js initial commit 5 years ago
constant.js initial commit 5 years ago
detect.js initial commit 5 years ago
detectLimit.js initial commit 5 years ago
detectSeries.js initial commit 5 years ago
dir.js initial commit 5 years ago
doDuring.js initial commit 5 years ago
doUntil.js initial commit 5 years ago
doWhilst.js initial commit 5 years ago
during.js initial commit 5 years ago
each.js initial commit 5 years ago
eachLimit.js initial commit 5 years ago
eachOf.js initial commit 5 years ago
eachOfLimit.js initial commit 5 years ago
eachOfSeries.js initial commit 5 years ago
eachSeries.js initial commit 5 years ago
ensureAsync.js initial commit 5 years ago
every.js initial commit 5 years ago
everyLimit.js initial commit 5 years ago
everySeries.js initial commit 5 years ago
filter.js initial commit 5 years ago
filterLimit.js initial commit 5 years ago
filterSeries.js initial commit 5 years ago
find.js initial commit 5 years ago
findLimit.js initial commit 5 years ago
findSeries.js initial commit 5 years ago
flatMap.js initial commit 5 years ago
flatMapLimit.js initial commit 5 years ago
flatMapSeries.js initial commit 5 years ago
foldl.js initial commit 5 years ago
foldr.js initial commit 5 years ago
forEach.js initial commit 5 years ago
forEachLimit.js initial commit 5 years ago
forEachOf.js initial commit 5 years ago
forEachOfLimit.js initial commit 5 years ago
forEachOfSeries.js initial commit 5 years ago
forEachSeries.js initial commit 5 years ago
forever.js initial commit 5 years ago
groupBy.js initial commit 5 years ago
groupByLimit.js initial commit 5 years ago
groupBySeries.js initial commit 5 years ago
index.js initial commit 5 years ago
inject.js initial commit 5 years ago
log.js initial commit 5 years ago
map.js initial commit 5 years ago
mapLimit.js initial commit 5 years ago
mapSeries.js initial commit 5 years ago
mapValues.js initial commit 5 years ago
mapValuesLimit.js initial commit 5 years ago
mapValuesSeries.js initial commit 5 years ago
memoize.js initial commit 5 years ago
nextTick.js initial commit 5 years ago
package.json initial commit 5 years ago
parallel.js initial commit 5 years ago
parallelLimit.js initial commit 5 years ago
priorityQueue.js initial commit 5 years ago
queue.js initial commit 5 years ago
race.js initial commit 5 years ago
reduce.js initial commit 5 years ago
reduceRight.js initial commit 5 years ago
reflect.js initial commit 5 years ago
reflectAll.js initial commit 5 years ago
reject.js initial commit 5 years ago
rejectLimit.js initial commit 5 years ago
rejectSeries.js initial commit 5 years ago
retry.js initial commit 5 years ago
retryable.js initial commit 5 years ago
select.js initial commit 5 years ago
selectLimit.js initial commit 5 years ago
selectSeries.js initial commit 5 years ago
seq.js initial commit 5 years ago
series.js initial commit 5 years ago
setImmediate.js initial commit 5 years ago
some.js initial commit 5 years ago
someLimit.js initial commit 5 years ago
someSeries.js initial commit 5 years ago
sortBy.js initial commit 5 years ago
timeout.js initial commit 5 years ago
times.js initial commit 5 years ago
timesLimit.js initial commit 5 years ago
timesSeries.js initial commit 5 years ago
transform.js initial commit 5 years ago
tryEach.js initial commit 5 years ago
unmemoize.js initial commit 5 years ago
until.js initial commit 5 years ago
waterfall.js initial commit 5 years ago
whilst.js initial commit 5 years ago
wrapSync.js initial commit 5 years ago

README.md

Async Logo

Build Status via Travis CI Build Status via Azure Pipelines NPM version Coverage Status Join the chat at https://gitter.im/caolan/async 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 async, it can also be used directly in the browser. A ESM version is included in the main async package that should automatically be used with compatible bundlers such as Webpack and Rollup.

A pure ESM version of Async is available as async-es.

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