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

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