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

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