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

README.md

Async Logo

Build Status via Travis CI NPM version Coverage Status libhive - Open source examples 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 install --save async, it can also be used directly in the browser.

This version of the package is optimized for the Node.js environment. If you use Async with webpack, install async-es instead.

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