amis-rpc-design/node_modules/async
2023-10-07 19:42:30 +08:00
..
dist v1.0.0 2023-10-07 19:42:30 +08:00
internal v1.0.0 2023-10-07 19:42:30 +08:00
all.js v1.0.0 2023-10-07 19:42:30 +08:00
allLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
allSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
any.js v1.0.0 2023-10-07 19:42:30 +08:00
anyLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
anySeries.js v1.0.0 2023-10-07 19:42:30 +08:00
apply.js v1.0.0 2023-10-07 19:42:30 +08:00
applyEach.js v1.0.0 2023-10-07 19:42:30 +08:00
applyEachSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
asyncify.js v1.0.0 2023-10-07 19:42:30 +08:00
auto.js v1.0.0 2023-10-07 19:42:30 +08:00
autoInject.js v1.0.0 2023-10-07 19:42:30 +08:00
bower.json v1.0.0 2023-10-07 19:42:30 +08:00
cargo.js v1.0.0 2023-10-07 19:42:30 +08:00
cargoQueue.js v1.0.0 2023-10-07 19:42:30 +08:00
CHANGELOG.md v1.0.0 2023-10-07 19:42:30 +08:00
compose.js v1.0.0 2023-10-07 19:42:30 +08:00
concat.js v1.0.0 2023-10-07 19:42:30 +08:00
concatLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
concatSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
constant.js v1.0.0 2023-10-07 19:42:30 +08:00
detect.js v1.0.0 2023-10-07 19:42:30 +08:00
detectLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
detectSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
dir.js v1.0.0 2023-10-07 19:42:30 +08:00
doDuring.js v1.0.0 2023-10-07 19:42:30 +08:00
doUntil.js v1.0.0 2023-10-07 19:42:30 +08:00
doWhilst.js v1.0.0 2023-10-07 19:42:30 +08:00
during.js v1.0.0 2023-10-07 19:42:30 +08:00
each.js v1.0.0 2023-10-07 19:42:30 +08:00
eachLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
eachOf.js v1.0.0 2023-10-07 19:42:30 +08:00
eachOfLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
eachOfSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
eachSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
ensureAsync.js v1.0.0 2023-10-07 19:42:30 +08:00
every.js v1.0.0 2023-10-07 19:42:30 +08:00
everyLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
everySeries.js v1.0.0 2023-10-07 19:42:30 +08:00
filter.js v1.0.0 2023-10-07 19:42:30 +08:00
filterLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
filterSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
find.js v1.0.0 2023-10-07 19:42:30 +08:00
findLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
findSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
flatMap.js v1.0.0 2023-10-07 19:42:30 +08:00
flatMapLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
flatMapSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
foldl.js v1.0.0 2023-10-07 19:42:30 +08:00
foldr.js v1.0.0 2023-10-07 19:42:30 +08:00
forEach.js v1.0.0 2023-10-07 19:42:30 +08:00
forEachLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
forEachOf.js v1.0.0 2023-10-07 19:42:30 +08:00
forEachOfLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
forEachOfSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
forEachSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
forever.js v1.0.0 2023-10-07 19:42:30 +08:00
groupBy.js v1.0.0 2023-10-07 19:42:30 +08:00
groupByLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
groupBySeries.js v1.0.0 2023-10-07 19:42:30 +08:00
index.js v1.0.0 2023-10-07 19:42:30 +08:00
inject.js v1.0.0 2023-10-07 19:42:30 +08:00
LICENSE v1.0.0 2023-10-07 19:42:30 +08:00
log.js v1.0.0 2023-10-07 19:42:30 +08:00
map.js v1.0.0 2023-10-07 19:42:30 +08:00
mapLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
mapSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
mapValues.js v1.0.0 2023-10-07 19:42:30 +08:00
mapValuesLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
mapValuesSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
memoize.js v1.0.0 2023-10-07 19:42:30 +08:00
nextTick.js v1.0.0 2023-10-07 19:42:30 +08:00
package.json v1.0.0 2023-10-07 19:42:30 +08:00
parallel.js v1.0.0 2023-10-07 19:42:30 +08:00
parallelLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
priorityQueue.js v1.0.0 2023-10-07 19:42:30 +08:00
queue.js v1.0.0 2023-10-07 19:42:30 +08:00
race.js v1.0.0 2023-10-07 19:42:30 +08:00
README.md v1.0.0 2023-10-07 19:42:30 +08:00
reduce.js v1.0.0 2023-10-07 19:42:30 +08:00
reduceRight.js v1.0.0 2023-10-07 19:42:30 +08:00
reflect.js v1.0.0 2023-10-07 19:42:30 +08:00
reflectAll.js v1.0.0 2023-10-07 19:42:30 +08:00
reject.js v1.0.0 2023-10-07 19:42:30 +08:00
rejectLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
rejectSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
retry.js v1.0.0 2023-10-07 19:42:30 +08:00
retryable.js v1.0.0 2023-10-07 19:42:30 +08:00
select.js v1.0.0 2023-10-07 19:42:30 +08:00
selectLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
selectSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
seq.js v1.0.0 2023-10-07 19:42:30 +08:00
series.js v1.0.0 2023-10-07 19:42:30 +08:00
setImmediate.js v1.0.0 2023-10-07 19:42:30 +08:00
some.js v1.0.0 2023-10-07 19:42:30 +08:00
someLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
someSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
sortBy.js v1.0.0 2023-10-07 19:42:30 +08:00
timeout.js v1.0.0 2023-10-07 19:42:30 +08:00
times.js v1.0.0 2023-10-07 19:42:30 +08:00
timesLimit.js v1.0.0 2023-10-07 19:42:30 +08:00
timesSeries.js v1.0.0 2023-10-07 19:42:30 +08:00
transform.js v1.0.0 2023-10-07 19:42:30 +08:00
tryEach.js v1.0.0 2023-10-07 19:42:30 +08:00
unmemoize.js v1.0.0 2023-10-07 19:42:30 +08:00
until.js v1.0.0 2023-10-07 19:42:30 +08:00
waterfall.js v1.0.0 2023-10-07 19:42:30 +08:00
whilst.js v1.0.0 2023-10-07 19:42:30 +08:00
wrapSync.js v1.0.0 2023-10-07 19:42:30 +08:00

Async Logo

Github Actions CI status NPM version Coverage Status Join the chat at https://gitter.im/caolan/async 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 i async, it can also be used directly in the browser. A ESM/MJS version is included in the main async package that should automatically be used with compatible bundlers such as Webpack and Rollup.

A pure ESM version of Async is available as async-es.

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