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

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