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