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

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