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