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