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,806
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
async-es
Higher-order functions and common patterns for asynchronous code
Latest release 3.1.0 - Updated - 25.8K stars
async.asyncify
async asyncifymethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async
Higher-order functions and common patterns for asynchronous code
Latest release 0.2.9 - Updated - 25.8K stars
async.eachseries
async eachseriesmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.auto
async automethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.seq
async seqmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.constant
async constantmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.log
async logmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async-seq
Original async, plus with two handy shortcuts: seq, iseq
Latest release 0.2.9 - Published - 25.8K stars
Async.js
Async is a utility module which provides straight-forward, powerful functions for working with as...
Latest release 0.1.22 - Published - 25.8K stars
org.webjars.bower:async
WebJar for async
Latest release 2.6.1 - Updated - 25.8K stars
async
Higher-order functions and common patterns for asynchronous code
Latest release 3.1.0 - Updated - 25.8K stars
front-async
Higher-order functions and common patterns for asynchronous code
Latest release 0.9.2-1 - Published - 25.8K stars
async.iterator
async iteratormethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.detectseries
async detectseriesmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.dowhilst
async dowhilstmethod as module.
Latest release 1.0.1 - Updated - 25.8K stars
async.parallellimit
async parallellimitmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.detectlimit
async detectlimitmethod as module.
Latest release 0.5.2 - Updated - 25.8K stars
async.until
async untilmethod as module.
Latest release 0.5.2 - Updated - 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