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

README.md

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