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