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