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

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