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

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