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

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