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

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