Skip to content
Async utilities for node and the browser
JavaScript CSS Other
Branch: master
Clone or download

Latest commit

timgates42 docs: Fix simple typo, whoses -> whose (#1717)
There is a small typo in dist/async.js, docs/v2/scripts/async.js, docs/v3/scripts/async.js, lib/groupBySeries.js.

Should read `whose` rather than `whoses`.
Latest commit 819a34b May 18, 2020

Files

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 docs: Fix simple typo, whoses -> whose (#1717) May 18, 2020
docs docs: Fix simple typo, whoses -> whose (#1717) May 18, 2020
lib docs: Fix simple typo, whoses -> whose (#1717) May 18, 2020
logo Include logo in .svg Jun 29, 2016
perf feat: Use heap tree in priority queue (#1595) Nov 21, 2018
support remove redundant npm test in xyz Feb 24, 2020
test fix tests related to wrapped function names Feb 24, 2020
.azure-pipelines-steps.yml re-enable coveralls on azure Jun 24, 2019
.azure-pipelines.yml update test matrixes Feb 24, 2020
.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 test matrixes Feb 24, 2020
CHANGELOG.md update changelog Feb 24, 2020
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 improve intro docs around async functions Feb 24, 2020
bower.json move mocha_tests/ to test/ Jun 3, 2018
index.js handle moved lodash internal methods Feb 10, 2016
intro.md improve intro docs around async functions Feb 24, 2020
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 Version 3.2.0 Feb 24, 2020

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 i async, it can also be used directly in the browser. A 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)
})
You can’t perform that action at this time.