Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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)
})