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

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