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

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