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