forked from dachan/dach
1
0
Fork 0
dach/node_modules/async
leca 30228b54ae a lot of changes 2023-10-22 22:39:45 +03:00
..
dist a lot of changes 2023-10-22 22:39:45 +03:00
internal a lot of changes 2023-10-22 22:39:45 +03:00
CHANGELOG.md a lot of changes 2023-10-22 22:39:45 +03:00
LICENSE a lot of changes 2023-10-22 22:39:45 +03:00
README.md a lot of changes 2023-10-22 22:39:45 +03:00
all.js a lot of changes 2023-10-22 22:39:45 +03:00
allLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
allSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
any.js a lot of changes 2023-10-22 22:39:45 +03:00
anyLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
anySeries.js a lot of changes 2023-10-22 22:39:45 +03:00
apply.js a lot of changes 2023-10-22 22:39:45 +03:00
applyEach.js a lot of changes 2023-10-22 22:39:45 +03:00
applyEachSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
asyncify.js a lot of changes 2023-10-22 22:39:45 +03:00
auto.js a lot of changes 2023-10-22 22:39:45 +03:00
autoInject.js a lot of changes 2023-10-22 22:39:45 +03:00
bower.json a lot of changes 2023-10-22 22:39:45 +03:00
cargo.js a lot of changes 2023-10-22 22:39:45 +03:00
cargoQueue.js a lot of changes 2023-10-22 22:39:45 +03:00
compose.js a lot of changes 2023-10-22 22:39:45 +03:00
concat.js a lot of changes 2023-10-22 22:39:45 +03:00
concatLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
concatSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
constant.js a lot of changes 2023-10-22 22:39:45 +03:00
detect.js a lot of changes 2023-10-22 22:39:45 +03:00
detectLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
detectSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
dir.js a lot of changes 2023-10-22 22:39:45 +03:00
doDuring.js a lot of changes 2023-10-22 22:39:45 +03:00
doUntil.js a lot of changes 2023-10-22 22:39:45 +03:00
doWhilst.js a lot of changes 2023-10-22 22:39:45 +03:00
during.js a lot of changes 2023-10-22 22:39:45 +03:00
each.js a lot of changes 2023-10-22 22:39:45 +03:00
eachLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
eachOf.js a lot of changes 2023-10-22 22:39:45 +03:00
eachOfLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
eachOfSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
eachSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
ensureAsync.js a lot of changes 2023-10-22 22:39:45 +03:00
every.js a lot of changes 2023-10-22 22:39:45 +03:00
everyLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
everySeries.js a lot of changes 2023-10-22 22:39:45 +03:00
filter.js a lot of changes 2023-10-22 22:39:45 +03:00
filterLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
filterSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
find.js a lot of changes 2023-10-22 22:39:45 +03:00
findLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
findSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
flatMap.js a lot of changes 2023-10-22 22:39:45 +03:00
flatMapLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
flatMapSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
foldl.js a lot of changes 2023-10-22 22:39:45 +03:00
foldr.js a lot of changes 2023-10-22 22:39:45 +03:00
forEach.js a lot of changes 2023-10-22 22:39:45 +03:00
forEachLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
forEachOf.js a lot of changes 2023-10-22 22:39:45 +03:00
forEachOfLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
forEachOfSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
forEachSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
forever.js a lot of changes 2023-10-22 22:39:45 +03:00
groupBy.js a lot of changes 2023-10-22 22:39:45 +03:00
groupByLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
groupBySeries.js a lot of changes 2023-10-22 22:39:45 +03:00
index.js a lot of changes 2023-10-22 22:39:45 +03:00
inject.js a lot of changes 2023-10-22 22:39:45 +03:00
log.js a lot of changes 2023-10-22 22:39:45 +03:00
map.js a lot of changes 2023-10-22 22:39:45 +03:00
mapLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
mapSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
mapValues.js a lot of changes 2023-10-22 22:39:45 +03:00
mapValuesLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
mapValuesSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
memoize.js a lot of changes 2023-10-22 22:39:45 +03:00
nextTick.js a lot of changes 2023-10-22 22:39:45 +03:00
package.json a lot of changes 2023-10-22 22:39:45 +03:00
parallel.js a lot of changes 2023-10-22 22:39:45 +03:00
parallelLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
priorityQueue.js a lot of changes 2023-10-22 22:39:45 +03:00
queue.js a lot of changes 2023-10-22 22:39:45 +03:00
race.js a lot of changes 2023-10-22 22:39:45 +03:00
reduce.js a lot of changes 2023-10-22 22:39:45 +03:00
reduceRight.js a lot of changes 2023-10-22 22:39:45 +03:00
reflect.js a lot of changes 2023-10-22 22:39:45 +03:00
reflectAll.js a lot of changes 2023-10-22 22:39:45 +03:00
reject.js a lot of changes 2023-10-22 22:39:45 +03:00
rejectLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
rejectSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
retry.js a lot of changes 2023-10-22 22:39:45 +03:00
retryable.js a lot of changes 2023-10-22 22:39:45 +03:00
select.js a lot of changes 2023-10-22 22:39:45 +03:00
selectLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
selectSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
seq.js a lot of changes 2023-10-22 22:39:45 +03:00
series.js a lot of changes 2023-10-22 22:39:45 +03:00
setImmediate.js a lot of changes 2023-10-22 22:39:45 +03:00
some.js a lot of changes 2023-10-22 22:39:45 +03:00
someLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
someSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
sortBy.js a lot of changes 2023-10-22 22:39:45 +03:00
timeout.js a lot of changes 2023-10-22 22:39:45 +03:00
times.js a lot of changes 2023-10-22 22:39:45 +03:00
timesLimit.js a lot of changes 2023-10-22 22:39:45 +03:00
timesSeries.js a lot of changes 2023-10-22 22:39:45 +03:00
transform.js a lot of changes 2023-10-22 22:39:45 +03:00
tryEach.js a lot of changes 2023-10-22 22:39:45 +03:00
unmemoize.js a lot of changes 2023-10-22 22:39:45 +03:00
until.js a lot of changes 2023-10-22 22:39:45 +03:00
waterfall.js a lot of changes 2023-10-22 22:39:45 +03:00
whilst.js a lot of changes 2023-10-22 22:39:45 +03:00
wrapSync.js a lot of changes 2023-10-22 22:39:45 +03:00

README.md

Async Logo

Github Actions CI status NPM version Coverage Status Join the chat at https://gitter.im/caolan/async 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 i async, it can also be used directly in the browser. A ESM/MJS version is included in the main async package that should automatically be used with compatible bundlers such as Webpack and Rollup.

A pure ESM version of Async is available as async-es.

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