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

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