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