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

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