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

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