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

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