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

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