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

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