Bakhtina Sofya b84cb877be 1st comm 2 месяцев назад
..
dist b84cb877be 1st comm 2 месяцев назад
internal b84cb877be 1st comm 2 месяцев назад
CHANGELOG.md b84cb877be 1st comm 2 месяцев назад
LICENSE b84cb877be 1st comm 2 месяцев назад
README.md b84cb877be 1st comm 2 месяцев назад
all.js b84cb877be 1st comm 2 месяцев назад
allLimit.js b84cb877be 1st comm 2 месяцев назад
allSeries.js b84cb877be 1st comm 2 месяцев назад
any.js b84cb877be 1st comm 2 месяцев назад
anyLimit.js b84cb877be 1st comm 2 месяцев назад
anySeries.js b84cb877be 1st comm 2 месяцев назад
apply.js b84cb877be 1st comm 2 месяцев назад
applyEach.js b84cb877be 1st comm 2 месяцев назад
applyEachSeries.js b84cb877be 1st comm 2 месяцев назад
asyncify.js b84cb877be 1st comm 2 месяцев назад
auto.js b84cb877be 1st comm 2 месяцев назад
autoInject.js b84cb877be 1st comm 2 месяцев назад
bower.json b84cb877be 1st comm 2 месяцев назад
cargo.js b84cb877be 1st comm 2 месяцев назад
compose.js b84cb877be 1st comm 2 месяцев назад
concat.js b84cb877be 1st comm 2 месяцев назад
concatLimit.js b84cb877be 1st comm 2 месяцев назад
concatSeries.js b84cb877be 1st comm 2 месяцев назад
constant.js b84cb877be 1st comm 2 месяцев назад
detect.js b84cb877be 1st comm 2 месяцев назад
detectLimit.js b84cb877be 1st comm 2 месяцев назад
detectSeries.js b84cb877be 1st comm 2 месяцев назад
dir.js b84cb877be 1st comm 2 месяцев назад
doDuring.js b84cb877be 1st comm 2 месяцев назад
doUntil.js b84cb877be 1st comm 2 месяцев назад
doWhilst.js b84cb877be 1st comm 2 месяцев назад
during.js b84cb877be 1st comm 2 месяцев назад
each.js b84cb877be 1st comm 2 месяцев назад
eachLimit.js b84cb877be 1st comm 2 месяцев назад
eachOf.js b84cb877be 1st comm 2 месяцев назад
eachOfLimit.js b84cb877be 1st comm 2 месяцев назад
eachOfSeries.js b84cb877be 1st comm 2 месяцев назад
eachSeries.js b84cb877be 1st comm 2 месяцев назад
ensureAsync.js b84cb877be 1st comm 2 месяцев назад
every.js b84cb877be 1st comm 2 месяцев назад
everyLimit.js b84cb877be 1st comm 2 месяцев назад
everySeries.js b84cb877be 1st comm 2 месяцев назад
filter.js b84cb877be 1st comm 2 месяцев назад
filterLimit.js b84cb877be 1st comm 2 месяцев назад
filterSeries.js b84cb877be 1st comm 2 месяцев назад
find.js b84cb877be 1st comm 2 месяцев назад
findLimit.js b84cb877be 1st comm 2 месяцев назад
findSeries.js b84cb877be 1st comm 2 месяцев назад
foldl.js b84cb877be 1st comm 2 месяцев назад
foldr.js b84cb877be 1st comm 2 месяцев назад
forEach.js b84cb877be 1st comm 2 месяцев назад
forEachLimit.js b84cb877be 1st comm 2 месяцев назад
forEachOf.js b84cb877be 1st comm 2 месяцев назад
forEachOfLimit.js b84cb877be 1st comm 2 месяцев назад
forEachOfSeries.js b84cb877be 1st comm 2 месяцев назад
forEachSeries.js b84cb877be 1st comm 2 месяцев назад
forever.js b84cb877be 1st comm 2 месяцев назад
groupBy.js b84cb877be 1st comm 2 месяцев назад
groupByLimit.js b84cb877be 1st comm 2 месяцев назад
groupBySeries.js b84cb877be 1st comm 2 месяцев назад
index.js b84cb877be 1st comm 2 месяцев назад
inject.js b84cb877be 1st comm 2 месяцев назад
log.js b84cb877be 1st comm 2 месяцев назад
map.js b84cb877be 1st comm 2 месяцев назад
mapLimit.js b84cb877be 1st comm 2 месяцев назад
mapSeries.js b84cb877be 1st comm 2 месяцев назад
mapValues.js b84cb877be 1st comm 2 месяцев назад
mapValuesLimit.js b84cb877be 1st comm 2 месяцев назад
mapValuesSeries.js b84cb877be 1st comm 2 месяцев назад
memoize.js b84cb877be 1st comm 2 месяцев назад
nextTick.js b84cb877be 1st comm 2 месяцев назад
package.json b84cb877be 1st comm 2 месяцев назад
parallel.js b84cb877be 1st comm 2 месяцев назад
parallelLimit.js b84cb877be 1st comm 2 месяцев назад
priorityQueue.js b84cb877be 1st comm 2 месяцев назад
queue.js b84cb877be 1st comm 2 месяцев назад
race.js b84cb877be 1st comm 2 месяцев назад
reduce.js b84cb877be 1st comm 2 месяцев назад
reduceRight.js b84cb877be 1st comm 2 месяцев назад
reflect.js b84cb877be 1st comm 2 месяцев назад
reflectAll.js b84cb877be 1st comm 2 месяцев назад
reject.js b84cb877be 1st comm 2 месяцев назад
rejectLimit.js b84cb877be 1st comm 2 месяцев назад
rejectSeries.js b84cb877be 1st comm 2 месяцев назад
retry.js b84cb877be 1st comm 2 месяцев назад
retryable.js b84cb877be 1st comm 2 месяцев назад
select.js b84cb877be 1st comm 2 месяцев назад
selectLimit.js b84cb877be 1st comm 2 месяцев назад
selectSeries.js b84cb877be 1st comm 2 месяцев назад
seq.js b84cb877be 1st comm 2 месяцев назад
series.js b84cb877be 1st comm 2 месяцев назад
setImmediate.js b84cb877be 1st comm 2 месяцев назад
some.js b84cb877be 1st comm 2 месяцев назад
someLimit.js b84cb877be 1st comm 2 месяцев назад
someSeries.js b84cb877be 1st comm 2 месяцев назад
sortBy.js b84cb877be 1st comm 2 месяцев назад
timeout.js b84cb877be 1st comm 2 месяцев назад
times.js b84cb877be 1st comm 2 месяцев назад
timesLimit.js b84cb877be 1st comm 2 месяцев назад
timesSeries.js b84cb877be 1st comm 2 месяцев назад
transform.js b84cb877be 1st comm 2 месяцев назад
tryEach.js b84cb877be 1st comm 2 месяцев назад
unmemoize.js b84cb877be 1st comm 2 месяцев назад
until.js b84cb877be 1st comm 2 месяцев назад
waterfall.js b84cb877be 1st comm 2 месяцев назад
whilst.js b84cb877be 1st comm 2 месяцев назад
wrapSync.js b84cb877be 1st comm 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)
})