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

README.md

Async Logo

Build Status via Travis CI NPM version Coverage Status Join the chat at https://gitter.im/caolan/async 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)
})