吕君喜 406d880ac6 first 3 rokov pred
..
dist 406d880ac6 first 3 rokov pred
internal 406d880ac6 first 3 rokov pred
CHANGELOG.md 406d880ac6 first 3 rokov pred
LICENSE 406d880ac6 first 3 rokov pred
README.md 406d880ac6 first 3 rokov pred
every.js 406d880ac6 first 3 rokov pred
allLimit.js 406d880ac6 first 3 rokov pred
allSeries.js 406d880ac6 first 3 rokov pred
some.js 406d880ac6 first 3 rokov pred
someLimit.js 406d880ac6 first 3 rokov pred
someSeries.js 406d880ac6 first 3 rokov pred
apply.js 406d880ac6 first 3 rokov pred
applyEach.js 406d880ac6 first 3 rokov pred
applyEachSeries.js 406d880ac6 first 3 rokov pred
wrapSync.js 406d880ac6 first 3 rokov pred
auto.js 406d880ac6 first 3 rokov pred
autoInject.js 406d880ac6 first 3 rokov pred
bower.json 406d880ac6 first 3 rokov pred
cargo.js 406d880ac6 first 3 rokov pred
compose.js 406d880ac6 first 3 rokov pred
concat.js 406d880ac6 first 3 rokov pred
concatLimit.js 406d880ac6 first 3 rokov pred
concatSeries.js 406d880ac6 first 3 rokov pred
constant.js 406d880ac6 first 3 rokov pred
find.js 406d880ac6 first 3 rokov pred
findLimit.js 406d880ac6 first 3 rokov pred
detectSeries.js 406d880ac6 first 3 rokov pred
dir.js 406d880ac6 first 3 rokov pred
doDuring.js 406d880ac6 first 3 rokov pred
doUntil.js 406d880ac6 first 3 rokov pred
doWhilst.js 406d880ac6 first 3 rokov pred
during.js 406d880ac6 first 3 rokov pred
forEach.js 406d880ac6 first 3 rokov pred
forEachLimit.js 406d880ac6 first 3 rokov pred
forEachOf.js 406d880ac6 first 3 rokov pred
forEachOfLimit.js 406d880ac6 first 3 rokov pred
forEachOfSeries.js 406d880ac6 first 3 rokov pred
forEachSeries.js 406d880ac6 first 3 rokov pred
ensureAsync.js 406d880ac6 first 3 rokov pred
every.js 406d880ac6 first 3 rokov pred
allLimit.js 406d880ac6 first 3 rokov pred
allSeries.js 406d880ac6 first 3 rokov pred
select.js 406d880ac6 first 3 rokov pred
selectLimit.js 406d880ac6 first 3 rokov pred
selectSeries.js 406d880ac6 first 3 rokov pred
find.js 406d880ac6 first 3 rokov pred
findLimit.js 406d880ac6 first 3 rokov pred
detectSeries.js 406d880ac6 first 3 rokov pred
reduce.js 406d880ac6 first 3 rokov pred
reduceRight.js 406d880ac6 first 3 rokov pred
forEach.js 406d880ac6 first 3 rokov pred
forEachLimit.js 406d880ac6 first 3 rokov pred
forEachOf.js 406d880ac6 first 3 rokov pred
forEachOfLimit.js 406d880ac6 first 3 rokov pred
forEachOfSeries.js 406d880ac6 first 3 rokov pred
forEachSeries.js 406d880ac6 first 3 rokov pred
forever.js 406d880ac6 first 3 rokov pred
groupBy.js 406d880ac6 first 3 rokov pred
groupByLimit.js 406d880ac6 first 3 rokov pred
groupBySeries.js 406d880ac6 first 3 rokov pred
index.js 406d880ac6 first 3 rokov pred
reduce.js 406d880ac6 first 3 rokov pred
log.js 406d880ac6 first 3 rokov pred
map.js 406d880ac6 first 3 rokov pred
mapLimit.js 406d880ac6 first 3 rokov pred
mapSeries.js 406d880ac6 first 3 rokov pred
mapValues.js 406d880ac6 first 3 rokov pred
mapValuesLimit.js 406d880ac6 first 3 rokov pred
mapValuesSeries.js 406d880ac6 first 3 rokov pred
memoize.js 406d880ac6 first 3 rokov pred
nextTick.js 406d880ac6 first 3 rokov pred
package.json 406d880ac6 first 3 rokov pred
parallel.js 406d880ac6 first 3 rokov pred
parallelLimit.js 406d880ac6 first 3 rokov pred
priorityQueue.js 406d880ac6 first 3 rokov pred
queue.js 406d880ac6 first 3 rokov pred
race.js 406d880ac6 first 3 rokov pred
reduce.js 406d880ac6 first 3 rokov pred
reduceRight.js 406d880ac6 first 3 rokov pred
reflect.js 406d880ac6 first 3 rokov pred
reflectAll.js 406d880ac6 first 3 rokov pred
reject.js 406d880ac6 first 3 rokov pred
rejectLimit.js 406d880ac6 first 3 rokov pred
rejectSeries.js 406d880ac6 first 3 rokov pred
retry.js 406d880ac6 first 3 rokov pred
retryable.js 406d880ac6 first 3 rokov pred
select.js 406d880ac6 first 3 rokov pred
selectLimit.js 406d880ac6 first 3 rokov pred
selectSeries.js 406d880ac6 first 3 rokov pred
seq.js 406d880ac6 first 3 rokov pred
series.js 406d880ac6 first 3 rokov pred
setImmediate.js 406d880ac6 first 3 rokov pred
some.js 406d880ac6 first 3 rokov pred
someLimit.js 406d880ac6 first 3 rokov pred
someSeries.js 406d880ac6 first 3 rokov pred
sortBy.js 406d880ac6 first 3 rokov pred
timeout.js 406d880ac6 first 3 rokov pred
times.js 406d880ac6 first 3 rokov pred
timesLimit.js 406d880ac6 first 3 rokov pred
timesSeries.js 406d880ac6 first 3 rokov pred
transform.js 406d880ac6 first 3 rokov pred
tryEach.js 406d880ac6 first 3 rokov pred
unmemoize.js 406d880ac6 first 3 rokov pred
until.js 406d880ac6 first 3 rokov pred
waterfall.js 406d880ac6 first 3 rokov pred
whilst.js 406d880ac6 first 3 rokov pred
wrapSync.js 406d880ac6 first 3 rokov 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)
})