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

README.md

Async Logo

Github Actions CI status NPM version Coverage Status 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. An 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)
})