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