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