async (3.2.6)
Published 2026-02-24 13:53:09 +00:00 by atheaadmin
Installation
registry=npm install async@3.2.6"async": "3.2.6"About this package
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. An 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)
})
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| @babel/core | 7.25.2 |
| @babel/eslint-parser | ^7.16.5 |
| babel-minify | ^0.5.0 |
| babel-plugin-add-module-exports | ^1.0.4 |
| babel-plugin-istanbul | ^7.0.0 |
| babel-plugin-syntax-async-generators | ^6.13.0 |
| babel-plugin-transform-es2015-modules-commonjs | ^6.26.2 |
| babel-preset-es2015 | ^6.3.13 |
| babel-preset-es2017 | ^6.22.0 |
| babel-register | ^6.26.0 |
| babelify | ^10.0.0 |
| benchmark | ^2.1.1 |
| bluebird | ^3.4.6 |
| browserify | ^17.0.0 |
| chai | ^4.2.0 |
| cheerio | ^0.22.0 |
| es6-promise | ^4.2.8 |
| eslint | ^8.6.0 |
| eslint-plugin-prefer-arrow | ^1.2.3 |
| fs-extra | ^11.1.1 |
| jsdoc | ^4.0.3 |
| karma | ^6.3.12 |
| karma-browserify | ^8.1.0 |
| karma-firefox-launcher | ^2.1.2 |
| karma-mocha | ^2.0.1 |
| karma-mocha-reporter | ^2.2.0 |
| karma-safari-launcher | ^1.0.0 |
| mocha | ^6.1.4 |
| native-promise-only | ^0.8.0-a |
| nyc | ^17.0.0 |
| rollup | ^4.2.0 |
| rollup-plugin-node-resolve | ^5.2.0 |
| rollup-plugin-npm | ^2.0.0 |
| rsvp | ^4.8.5 |
| semver | ^7.3.5 |
| yargs | ^17.3.1 |
Keywords
async
callback
module
utility
Details
Assets (1)
Versions (3)
View all
async-3.2.6.tgz
147 KiB
