Skip to content
Async utilities for node and the browser
JavaScript CSS Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add a issue template for users filing new issues May 19, 2016
dist Update built files Jun 23, 2019
docs fix(docs): applyEach docs. Closes #1658 Jun 23, 2019
lib even moar coverage Jun 23, 2019
logo Include logo in .svg Jun 29, 2016
perf feat: Use heap tree in priority queue (#1595) Nov 21, 2018
support fix: include config for browserify. Closes #1653 Jun 23, 2019
test chore: tighten up timeout on times Jun 30, 2019
.azure-pipelines-steps.yml re-enable coveralls on azure Jun 24, 2019
.azure-pipelines.yml update matrix to remove node 6 and add 12 Jun 30, 2019
.babelrc [wip] initial async generator support (#1560) Aug 5, 2018
.editorconfig update code style, increase linter coverage, refactor makefile Jan 16, 2016
.eslintrc [wip] initial async generator support (#1560) Aug 5, 2018
.gitattributes Add .gitattributes Jun 2, 2016
.gitignore docs: use `docs/` folder, include links for every major version (#1648) May 27, 2019
.npmignore Ignore logo folder by npm Jun 29, 2016
.travis.yml update matrix to remove node 6 and add 12 Jun 30, 2019
CHANGELOG.md update changelog Jun 23, 2019
LICENSE Update license year range to 2018 Jan 20, 2018
Makefile separate clean from all Jun 23, 2019
README.es.md hide erroring azure badges Jun 23, 2019
README.md hide erroring azure badges Jun 23, 2019
bower.json move mocha_tests/ to test/ Jun 3, 2018
index.js handle moved lodash internal methods Feb 10, 2016
intro.md fix(docs): correct browser support. Closes #1643 May 24, 2019
karma.conf.js chore: Add Azure Pipelines for CI (Windows, Linux, Mac) (#1630), Fix … Apr 7, 2019
package-lock.json chore: update more dev deps Jun 30, 2019
package.json chore: update more dev deps Jun 30, 2019

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)
})
You can’t perform that action at this time.