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

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