caolan/async


Async utilities for node and the browser

http://caolan.github.io/async/

License: MIT

Language: JavaScript

Keywords: async, callbacks, javascript


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)
})

Project Statistics

Sourcerank 23
Repository Size 5.44 MB
Stars 25,798
Forks 2,325
Watchers 727
Open issues 2
Dependencies 799
Contributors 230
Tags 80
Created
Last updated
Last pushed

Top Contributors See all

Alex Early Caolan McMahon Graeme Yeates Hubert Argasinski Beau Gunderson Ivan Seidel Eugene Zubarev Federico Brigante theif Aydar Zartdinov Brian Maissy Suguru Motegi Fritz Lin Brian Spates Justin Jesse Houchins Ilya Ray Myers Allan Carroll Manuel Ernst

Packages Referencing this Repo

async
Async utilities for node and the browser
Latest release v2.6.3 - Published - 25.8K stars
org.webjars.npm:async
WebJar for async
Latest release 2.6.1 - Updated - 25.8K stars
async.dir
async dirmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.each
async eachmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.nexttick
async nexttickmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.setimmediate
async setimmediatemethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.doduring
async doduringmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.queue
async queuemethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.cargo
async cargomethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.unmemoize
async unmemoizemethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.times
async timesmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.timesseries
async timesseriesmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.applyeach
async applyeachmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.applyeachseries
async applyeachseriesmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.timeslimit
async timeslimitmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.compose
async composemethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.forever
async forevermethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.eachlimit
async eachlimitmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.eachof
async eachofmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
everythingstays-async
Higher-order functions and common patterns for asynchronous code
Latest release 2.0.0-rc.2 - Published - 25.8K stars

Recent Tags See all

v2.6.3 July 14, 2019
v3.1.0 June 23, 2019
v3.0.1 May 26, 2019
v3.0.0 May 20, 2019
v2.6.2 February 12, 2019
v3.0.1-0 October 01, 2018
v2.6.1 May 21, 2018
v2.6.0 November 07, 2017
v2.5.0 June 25, 2017
v2.5.0 June 25, 2017
v2.4.1 May 22, 2017
v2.4.0 April 29, 2017
v2.3.0 April 02, 2017
v2.2.0 March 25, 2017
v2.1.5 February 19, 2017

Interesting Forks See all

sokra/async
Async utilities for node and the browser
JavaScript - MIT - Last pushed - 4 stars
vbuterin/async
Async utilities for node and the browser
JavaScript - MIT - Last pushed - 3 stars
lutaoact/myasync
Async utilities for node and the browser
JavaScript - MIT - Last pushed - 3 stars
mikedeboer/mozAsync
Async utilities for node and the browser
JavaScript - MIT - Last pushed - 3 stars
jacklovepdf/async
Async utilities for node and the browser
JavaScript - Updated - 2 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-05-26 21:46:53 UTC

Login to resync this repository