Mohammad Asif cf937194cb Removed un-waned things 1. 6 月之前
..
dist cf937194cb Removed un-waned things 1. 6 月之前
internal cf937194cb Removed un-waned things 1. 6 月之前
CHANGELOG.md cf937194cb Removed un-waned things 1. 6 月之前
LICENSE cf937194cb Removed un-waned things 1. 6 月之前
README.md cf937194cb Removed un-waned things 1. 6 月之前
all.js cf937194cb Removed un-waned things 1. 6 月之前
allLimit.js cf937194cb Removed un-waned things 1. 6 月之前
allSeries.js cf937194cb Removed un-waned things 1. 6 月之前
any.js cf937194cb Removed un-waned things 1. 6 月之前
anyLimit.js cf937194cb Removed un-waned things 1. 6 月之前
anySeries.js cf937194cb Removed un-waned things 1. 6 月之前
apply.js cf937194cb Removed un-waned things 1. 6 月之前
applyEach.js cf937194cb Removed un-waned things 1. 6 月之前
applyEachSeries.js cf937194cb Removed un-waned things 1. 6 月之前
asyncify.js cf937194cb Removed un-waned things 1. 6 月之前
auto.js cf937194cb Removed un-waned things 1. 6 月之前
autoInject.js cf937194cb Removed un-waned things 1. 6 月之前
bower.json cf937194cb Removed un-waned things 1. 6 月之前
cargo.js cf937194cb Removed un-waned things 1. 6 月之前
cargoQueue.js cf937194cb Removed un-waned things 1. 6 月之前
compose.js cf937194cb Removed un-waned things 1. 6 月之前
concat.js cf937194cb Removed un-waned things 1. 6 月之前
concatLimit.js cf937194cb Removed un-waned things 1. 6 月之前
concatSeries.js cf937194cb Removed un-waned things 1. 6 月之前
constant.js cf937194cb Removed un-waned things 1. 6 月之前
detect.js cf937194cb Removed un-waned things 1. 6 月之前
detectLimit.js cf937194cb Removed un-waned things 1. 6 月之前
detectSeries.js cf937194cb Removed un-waned things 1. 6 月之前
dir.js cf937194cb Removed un-waned things 1. 6 月之前
doDuring.js cf937194cb Removed un-waned things 1. 6 月之前
doUntil.js cf937194cb Removed un-waned things 1. 6 月之前
doWhilst.js cf937194cb Removed un-waned things 1. 6 月之前
during.js cf937194cb Removed un-waned things 1. 6 月之前
each.js cf937194cb Removed un-waned things 1. 6 月之前
eachLimit.js cf937194cb Removed un-waned things 1. 6 月之前
eachOf.js cf937194cb Removed un-waned things 1. 6 月之前
eachOfLimit.js cf937194cb Removed un-waned things 1. 6 月之前
eachOfSeries.js cf937194cb Removed un-waned things 1. 6 月之前
eachSeries.js cf937194cb Removed un-waned things 1. 6 月之前
ensureAsync.js cf937194cb Removed un-waned things 1. 6 月之前
every.js cf937194cb Removed un-waned things 1. 6 月之前
everyLimit.js cf937194cb Removed un-waned things 1. 6 月之前
everySeries.js cf937194cb Removed un-waned things 1. 6 月之前
filter.js cf937194cb Removed un-waned things 1. 6 月之前
filterLimit.js cf937194cb Removed un-waned things 1. 6 月之前
filterSeries.js cf937194cb Removed un-waned things 1. 6 月之前
find.js cf937194cb Removed un-waned things 1. 6 月之前
findLimit.js cf937194cb Removed un-waned things 1. 6 月之前
findSeries.js cf937194cb Removed un-waned things 1. 6 月之前
flatMap.js cf937194cb Removed un-waned things 1. 6 月之前
flatMapLimit.js cf937194cb Removed un-waned things 1. 6 月之前
flatMapSeries.js cf937194cb Removed un-waned things 1. 6 月之前
foldl.js cf937194cb Removed un-waned things 1. 6 月之前
foldr.js cf937194cb Removed un-waned things 1. 6 月之前
forEach.js cf937194cb Removed un-waned things 1. 6 月之前
forEachLimit.js cf937194cb Removed un-waned things 1. 6 月之前
forEachOf.js cf937194cb Removed un-waned things 1. 6 月之前
forEachOfLimit.js cf937194cb Removed un-waned things 1. 6 月之前
forEachOfSeries.js cf937194cb Removed un-waned things 1. 6 月之前
forEachSeries.js cf937194cb Removed un-waned things 1. 6 月之前
forever.js cf937194cb Removed un-waned things 1. 6 月之前
groupBy.js cf937194cb Removed un-waned things 1. 6 月之前
groupByLimit.js cf937194cb Removed un-waned things 1. 6 月之前
groupBySeries.js cf937194cb Removed un-waned things 1. 6 月之前
index.js cf937194cb Removed un-waned things 1. 6 月之前
inject.js cf937194cb Removed un-waned things 1. 6 月之前
log.js cf937194cb Removed un-waned things 1. 6 月之前
map.js cf937194cb Removed un-waned things 1. 6 月之前
mapLimit.js cf937194cb Removed un-waned things 1. 6 月之前
mapSeries.js cf937194cb Removed un-waned things 1. 6 月之前
mapValues.js cf937194cb Removed un-waned things 1. 6 月之前
mapValuesLimit.js cf937194cb Removed un-waned things 1. 6 月之前
mapValuesSeries.js cf937194cb Removed un-waned things 1. 6 月之前
memoize.js cf937194cb Removed un-waned things 1. 6 月之前
nextTick.js cf937194cb Removed un-waned things 1. 6 月之前
package.json cf937194cb Removed un-waned things 1. 6 月之前
parallel.js cf937194cb Removed un-waned things 1. 6 月之前
parallelLimit.js cf937194cb Removed un-waned things 1. 6 月之前
priorityQueue.js cf937194cb Removed un-waned things 1. 6 月之前
queue.js cf937194cb Removed un-waned things 1. 6 月之前
race.js cf937194cb Removed un-waned things 1. 6 月之前
reduce.js cf937194cb Removed un-waned things 1. 6 月之前
reduceRight.js cf937194cb Removed un-waned things 1. 6 月之前
reflect.js cf937194cb Removed un-waned things 1. 6 月之前
reflectAll.js cf937194cb Removed un-waned things 1. 6 月之前
reject.js cf937194cb Removed un-waned things 1. 6 月之前
rejectLimit.js cf937194cb Removed un-waned things 1. 6 月之前
rejectSeries.js cf937194cb Removed un-waned things 1. 6 月之前
retry.js cf937194cb Removed un-waned things 1. 6 月之前
retryable.js cf937194cb Removed un-waned things 1. 6 月之前
select.js cf937194cb Removed un-waned things 1. 6 月之前
selectLimit.js cf937194cb Removed un-waned things 1. 6 月之前
selectSeries.js cf937194cb Removed un-waned things 1. 6 月之前
seq.js cf937194cb Removed un-waned things 1. 6 月之前
series.js cf937194cb Removed un-waned things 1. 6 月之前
setImmediate.js cf937194cb Removed un-waned things 1. 6 月之前
some.js cf937194cb Removed un-waned things 1. 6 月之前
someLimit.js cf937194cb Removed un-waned things 1. 6 月之前
someSeries.js cf937194cb Removed un-waned things 1. 6 月之前
sortBy.js cf937194cb Removed un-waned things 1. 6 月之前
timeout.js cf937194cb Removed un-waned things 1. 6 月之前
times.js cf937194cb Removed un-waned things 1. 6 月之前
timesLimit.js cf937194cb Removed un-waned things 1. 6 月之前
timesSeries.js cf937194cb Removed un-waned things 1. 6 月之前
transform.js cf937194cb Removed un-waned things 1. 6 月之前
tryEach.js cf937194cb Removed un-waned things 1. 6 月之前
unmemoize.js cf937194cb Removed un-waned things 1. 6 月之前
until.js cf937194cb Removed un-waned things 1. 6 月之前
waterfall.js cf937194cb Removed un-waned things 1. 6 月之前
whilst.js cf937194cb Removed un-waned things 1. 6 月之前
wrapSync.js cf937194cb Removed un-waned things 1. 6 月之前

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