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

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