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