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