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

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