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

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