tree: 2e14087ea0378295af4d1773793d855e68e6a9f5 [path history] [tgz]
  1. dist/
  2. internal/
  3. all.js
  4. allLimit.js
  5. allSeries.js
  6. any.js
  7. anyLimit.js
  8. anySeries.js
  9. apply.js
  10. applyEach.js
  11. applyEachSeries.js
  12. asyncify.js
  13. auto.js
  14. autoInject.js
  15. bower.json
  16. cargo.js
  17. cargoQueue.js
  18. CHANGELOG.md
  19. compose.js
  20. concat.js
  21. concatLimit.js
  22. concatSeries.js
  23. constant.js
  24. detect.js
  25. detectLimit.js
  26. detectSeries.js
  27. dir.js
  28. doDuring.js
  29. doUntil.js
  30. doWhilst.js
  31. during.js
  32. each.js
  33. eachLimit.js
  34. eachOf.js
  35. eachOfLimit.js
  36. eachOfSeries.js
  37. eachSeries.js
  38. ensureAsync.js
  39. every.js
  40. everyLimit.js
  41. everySeries.js
  42. filter.js
  43. filterLimit.js
  44. filterSeries.js
  45. find.js
  46. findLimit.js
  47. findSeries.js
  48. flatMap.js
  49. flatMapLimit.js
  50. flatMapSeries.js
  51. foldl.js
  52. foldr.js
  53. forEach.js
  54. forEachLimit.js
  55. forEachOf.js
  56. forEachOfLimit.js
  57. forEachOfSeries.js
  58. forEachSeries.js
  59. forever.js
  60. groupBy.js
  61. groupByLimit.js
  62. groupBySeries.js
  63. index.js
  64. inject.js
  65. LICENSE
  66. log.js
  67. map.js
  68. mapLimit.js
  69. mapSeries.js
  70. mapValues.js
  71. mapValuesLimit.js
  72. mapValuesSeries.js
  73. memoize.js
  74. nextTick.js
  75. package.json
  76. parallel.js
  77. parallelLimit.js
  78. priorityQueue.js
  79. queue.js
  80. race.js
  81. README.md
  82. reduce.js
  83. reduceRight.js
  84. reflect.js
  85. reflectAll.js
  86. reject.js
  87. rejectLimit.js
  88. rejectSeries.js
  89. retry.js
  90. retryable.js
  91. select.js
  92. selectLimit.js
  93. selectSeries.js
  94. seq.js
  95. series.js
  96. setImmediate.js
  97. some.js
  98. someLimit.js
  99. someSeries.js
  100. sortBy.js
  101. timeout.js
  102. times.js
  103. timesLimit.js
  104. timesSeries.js
  105. transform.js
  106. tryEach.js
  107. unmemoize.js
  108. until.js
  109. waterfall.js
  110. whilst.js
  111. wrapSync.js
src/third_party/devtools/node_modules/karma-typescript/node_modules/async/README.md

Async Logo

Build Status via Travis CI Build Status via Azure Pipelines 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 install async, it can also be used directly in the browser. A ESM 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)
})