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

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