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

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