Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
root d8c1b4a1be initial 5年前
..
dist initial 5年前
internal initial 5年前
CHANGELOG.md initial 5年前
LICENSE initial 5年前
README.md initial 5年前
all.js initial 5年前
allLimit.js initial 5年前
allSeries.js initial 5年前
any.js initial 5年前
anyLimit.js initial 5年前
anySeries.js initial 5年前
apply.js initial 5年前
applyEach.js initial 5年前
applyEachSeries.js initial 5年前
asyncify.js initial 5年前
auto.js initial 5年前
autoInject.js initial 5年前
bower.json initial 5年前
cargo.js initial 5年前
compose.js initial 5年前
concat.js initial 5年前
concatLimit.js initial 5年前
concatSeries.js initial 5年前
constant.js initial 5年前
detect.js initial 5年前
detectLimit.js initial 5年前
detectSeries.js initial 5年前
dir.js initial 5年前
doDuring.js initial 5年前
doUntil.js initial 5年前
doWhilst.js initial 5年前
during.js initial 5年前
each.js initial 5年前
eachLimit.js initial 5年前
eachOf.js initial 5年前
eachOfLimit.js initial 5年前
eachOfSeries.js initial 5年前
eachSeries.js initial 5年前
ensureAsync.js initial 5年前
every.js initial 5年前
everyLimit.js initial 5年前
everySeries.js initial 5年前
filter.js initial 5年前
filterLimit.js initial 5年前
filterSeries.js initial 5年前
find.js initial 5年前
findLimit.js initial 5年前
findSeries.js initial 5年前
foldl.js initial 5年前
foldr.js initial 5年前
forEach.js initial 5年前
forEachLimit.js initial 5年前
forEachOf.js initial 5年前
forEachOfLimit.js initial 5年前
forEachOfSeries.js initial 5年前
forEachSeries.js initial 5年前
forever.js initial 5年前
groupBy.js initial 5年前
groupByLimit.js initial 5年前
groupBySeries.js initial 5年前
index.js initial 5年前
inject.js initial 5年前
log.js initial 5年前
map.js initial 5年前
mapLimit.js initial 5年前
mapSeries.js initial 5年前
mapValues.js initial 5年前
mapValuesLimit.js initial 5年前
mapValuesSeries.js initial 5年前
memoize.js initial 5年前
nextTick.js initial 5年前
package.json initial 5年前
parallel.js initial 5年前
parallelLimit.js initial 5年前
priorityQueue.js initial 5年前
queue.js initial 5年前
race.js initial 5年前
reduce.js initial 5年前
reduceRight.js initial 5年前
reflect.js initial 5年前
reflectAll.js initial 5年前
reject.js initial 5年前
rejectLimit.js initial 5年前
rejectSeries.js initial 5年前
retry.js initial 5年前
retryable.js initial 5年前
select.js initial 5年前
selectLimit.js initial 5年前
selectSeries.js initial 5年前
seq.js initial 5年前
series.js initial 5年前
setImmediate.js initial 5年前
some.js initial 5年前
someLimit.js initial 5年前
someSeries.js initial 5年前
sortBy.js initial 5年前
timeout.js initial 5年前
times.js initial 5年前
timesLimit.js initial 5年前
timesSeries.js initial 5年前
transform.js initial 5年前
tryEach.js initial 5年前
unmemoize.js initial 5年前
until.js initial 5年前
waterfall.js initial 5年前
whilst.js initial 5年前
wrapSync.js initial 5年前

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