admin_vue/11-前端模块化开发Webpack(Node.js基础)/04-webpack_Loader使用/node_modules/async
3056762376@qq.com 37ffd941b0 changes 2022-11-20 18:09:09 +08:00
..
dist changes 2022-11-20 18:09:09 +08:00
internal changes 2022-11-20 18:09:09 +08:00
CHANGELOG.md changes 2022-11-20 18:09:09 +08:00
LICENSE changes 2022-11-20 18:09:09 +08:00
README.md changes 2022-11-20 18:09:09 +08:00
all.js changes 2022-11-20 18:09:09 +08:00
allLimit.js changes 2022-11-20 18:09:09 +08:00
allSeries.js changes 2022-11-20 18:09:09 +08:00
any.js changes 2022-11-20 18:09:09 +08:00
anyLimit.js changes 2022-11-20 18:09:09 +08:00
anySeries.js changes 2022-11-20 18:09:09 +08:00
apply.js changes 2022-11-20 18:09:09 +08:00
applyEach.js changes 2022-11-20 18:09:09 +08:00
applyEachSeries.js changes 2022-11-20 18:09:09 +08:00
asyncify.js changes 2022-11-20 18:09:09 +08:00
auto.js changes 2022-11-20 18:09:09 +08:00
autoInject.js changes 2022-11-20 18:09:09 +08:00
bower.json changes 2022-11-20 18:09:09 +08:00
cargo.js changes 2022-11-20 18:09:09 +08:00
compose.js changes 2022-11-20 18:09:09 +08:00
concat.js changes 2022-11-20 18:09:09 +08:00
concatLimit.js changes 2022-11-20 18:09:09 +08:00
concatSeries.js changes 2022-11-20 18:09:09 +08:00
constant.js changes 2022-11-20 18:09:09 +08:00
detect.js changes 2022-11-20 18:09:09 +08:00
detectLimit.js changes 2022-11-20 18:09:09 +08:00
detectSeries.js changes 2022-11-20 18:09:09 +08:00
dir.js changes 2022-11-20 18:09:09 +08:00
doDuring.js changes 2022-11-20 18:09:09 +08:00
doUntil.js changes 2022-11-20 18:09:09 +08:00
doWhilst.js changes 2022-11-20 18:09:09 +08:00
during.js changes 2022-11-20 18:09:09 +08:00
each.js changes 2022-11-20 18:09:09 +08:00
eachLimit.js changes 2022-11-20 18:09:09 +08:00
eachOf.js changes 2022-11-20 18:09:09 +08:00
eachOfLimit.js changes 2022-11-20 18:09:09 +08:00
eachOfSeries.js changes 2022-11-20 18:09:09 +08:00
eachSeries.js changes 2022-11-20 18:09:09 +08:00
ensureAsync.js changes 2022-11-20 18:09:09 +08:00
every.js changes 2022-11-20 18:09:09 +08:00
everyLimit.js changes 2022-11-20 18:09:09 +08:00
everySeries.js changes 2022-11-20 18:09:09 +08:00
filter.js changes 2022-11-20 18:09:09 +08:00
filterLimit.js changes 2022-11-20 18:09:09 +08:00
filterSeries.js changes 2022-11-20 18:09:09 +08:00
find.js changes 2022-11-20 18:09:09 +08:00
findLimit.js changes 2022-11-20 18:09:09 +08:00
findSeries.js changes 2022-11-20 18:09:09 +08:00
foldl.js changes 2022-11-20 18:09:09 +08:00
foldr.js changes 2022-11-20 18:09:09 +08:00
forEach.js changes 2022-11-20 18:09:09 +08:00
forEachLimit.js changes 2022-11-20 18:09:09 +08:00
forEachOf.js changes 2022-11-20 18:09:09 +08:00
forEachOfLimit.js changes 2022-11-20 18:09:09 +08:00
forEachOfSeries.js changes 2022-11-20 18:09:09 +08:00
forEachSeries.js changes 2022-11-20 18:09:09 +08:00
forever.js changes 2022-11-20 18:09:09 +08:00
groupBy.js changes 2022-11-20 18:09:09 +08:00
groupByLimit.js changes 2022-11-20 18:09:09 +08:00
groupBySeries.js changes 2022-11-20 18:09:09 +08:00
index.js changes 2022-11-20 18:09:09 +08:00
inject.js changes 2022-11-20 18:09:09 +08:00
log.js changes 2022-11-20 18:09:09 +08:00
map.js changes 2022-11-20 18:09:09 +08:00
mapLimit.js changes 2022-11-20 18:09:09 +08:00
mapSeries.js changes 2022-11-20 18:09:09 +08:00
mapValues.js changes 2022-11-20 18:09:09 +08:00
mapValuesLimit.js changes 2022-11-20 18:09:09 +08:00
mapValuesSeries.js changes 2022-11-20 18:09:09 +08:00
memoize.js changes 2022-11-20 18:09:09 +08:00
nextTick.js changes 2022-11-20 18:09:09 +08:00
package.json changes 2022-11-20 18:09:09 +08:00
parallel.js changes 2022-11-20 18:09:09 +08:00
parallelLimit.js changes 2022-11-20 18:09:09 +08:00
priorityQueue.js changes 2022-11-20 18:09:09 +08:00
queue.js changes 2022-11-20 18:09:09 +08:00
race.js changes 2022-11-20 18:09:09 +08:00
reduce.js changes 2022-11-20 18:09:09 +08:00
reduceRight.js changes 2022-11-20 18:09:09 +08:00
reflect.js changes 2022-11-20 18:09:09 +08:00
reflectAll.js changes 2022-11-20 18:09:09 +08:00
reject.js changes 2022-11-20 18:09:09 +08:00
rejectLimit.js changes 2022-11-20 18:09:09 +08:00
rejectSeries.js changes 2022-11-20 18:09:09 +08:00
retry.js changes 2022-11-20 18:09:09 +08:00
retryable.js changes 2022-11-20 18:09:09 +08:00
select.js changes 2022-11-20 18:09:09 +08:00
selectLimit.js changes 2022-11-20 18:09:09 +08:00
selectSeries.js changes 2022-11-20 18:09:09 +08:00
seq.js changes 2022-11-20 18:09:09 +08:00
series.js changes 2022-11-20 18:09:09 +08:00
setImmediate.js changes 2022-11-20 18:09:09 +08:00
some.js changes 2022-11-20 18:09:09 +08:00
someLimit.js changes 2022-11-20 18:09:09 +08:00
someSeries.js changes 2022-11-20 18:09:09 +08:00
sortBy.js changes 2022-11-20 18:09:09 +08:00
timeout.js changes 2022-11-20 18:09:09 +08:00
times.js changes 2022-11-20 18:09:09 +08:00
timesLimit.js changes 2022-11-20 18:09:09 +08:00
timesSeries.js changes 2022-11-20 18:09:09 +08:00
transform.js changes 2022-11-20 18:09:09 +08:00
tryEach.js changes 2022-11-20 18:09:09 +08:00
unmemoize.js changes 2022-11-20 18:09:09 +08:00
until.js changes 2022-11-20 18:09:09 +08:00
waterfall.js changes 2022-11-20 18:09:09 +08:00
whilst.js changes 2022-11-20 18:09:09 +08:00
wrapSync.js changes 2022-11-20 18:09:09 +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)
})