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

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