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

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