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

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