HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
caolan
async
JavaScript2010–2020
caolan / async

async

Async utilities for node and the browser

76Distinct people
81Mentions
2Explicit recommenders
28.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Async utilities for node and the browser

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

It's a little tiring to see some of the same old fallacies about Node repeated ad infinitum in this thread. I suspect a lot of the complaints stem from poor development…

yid used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 7:02:50 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year81 dated mentions

Observed mentions: 2010-10-12 01:05:50 UTC to 2020-01-21 18:21:07 UTC.

051015202010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 18 mentions; 1 submissions, 17 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 21 mentions; 0 submissions, 21 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 18 mentions; 0 submissions, 18 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 10 mentions; 0 submissions, 10 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC101
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC18117
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC21021
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC18018
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC10010
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC303
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC624
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
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) })
Read the full README on GitHub

What Hacker News says

21 sources
Perhaps, but lacking a formal ToC and using the "review" that's listed on Amazon, I'm not seeing any indication of: * ES5 * CommonJS * promises/deferreds * AMD/UMD/etc. * NodeJS * asynchronous concerns such as callback hell (and other focus areas as addressed by Async.js[1]) * packages * HTML5 * the MV* hysteria Granted, many of those aren't central to "JS" proper, they should at least bear a mention....but perhaps not. Just seems like what's covered is mostly run-of-the-mill JS fodder... 1. https://github.com/caolan/async#readme
In John Resig's ‘Secrets of the JavaScript Ninja’ has been released
I don't think that this style is fantastic. This means that the pair of success/error callbacks is not reified, so there isn't a single object to pass around or manipulate. The result is that composition is harder. In order to create higher order asynchronous operations, like those in Async.js [1], you need to either pass two arguments or use an array or object to pair the error handlers together. This is particularly important if you want to return a pair of handlers from a function. In the two-callback model, the most common way to reify the handler pair is with a {success:...,error:...} object. This is much better than function(x,y,z,success,error), but still has the problem that you now need to override two handlers if you want to wrap some completion logic, regardless of success/failure. For example, if you want to close a file handl
Read the rest
e, win or lose, you need to provide two new functions. Composition greatly benefits from a singular object. The Node.js approach is the (err,data) callback. It's an extremely simple and successful approach. The other approach are promises/futures, which internally can be implemented with one or more callbacks, but provide a nice clean interface for composition. You could get that with success/error objects, but you're exposing the internals rather than an interface, like you should be doing. A good promise interface would let you choose an implementation without tying you to any particular callback model. [1] https://github.com/caolan/async
In Node.js error handling
Nested callbacks are a problem that every javascript/node.js developer runs in to. A common library to help with this and other issues is Async: https://github.com/caolan/async Sometimes, it's just better to give your functions names, and pull them out. RSVP.js looks nice. Also, I like jQuery's implantation of promises specifically with the ajax function.
In Rsvp.js
Here's a few sources I really liked: * Express - https://github.com/visionmedia/express - I don't like TJ's coding style, and general trolling of CoffeeScript, but this is a really great, clean and tiny codebase. (As well as all the connect middlewares - https://github.com/senchalabs/connect) * Async - https://github.com/caolan/async - is very readable. Async is a great library for async ops handling in JS, and it's really neat seeing the implementation patterns. * Ray - is a games DSL in Ruby - https://github.com/Mon-Ouie/ray - I love it, and it's a great read especially if you are interested in DSLs as much as I do. * Jekyll - https://github.com/mojombo/jekyll - really helped me going forward with my ruby skills. It's nice, clean, commented, not too big, and useful. * Redis - https://github.com/antirez/redis - lots of data structure imp
Read the rest
lementations. Antirez just writes C so nicely. anet.c has networking, TCP bits, ae.c is an event loop. Lots of great code there.
In Reading Other People's Code
Node.js actually has two problems that I think will be very major issues for it in the long run: - it's based on JavaScript, which is a crappy language (despite how nice V8 is) - (OP's point) the async style is horrible for readability, which puts a tremendous toll on productivity (though many will deny it). There are libraries like async (https://github.com/caolan/async) and streamline (https://github.com/Sage/streamlinejs) which try to eliminate #2. They are band-aids: the language itself must support asynchronous execution without callbacks. Node has many advantages that make it really nice - V8 is awesome because of an interesting case of technological path dependence; the standard library has a lot of modules that take great advantage of asynchronous I/O; the standard library is very high quality; the community is great - but I think
Read the rest
the two issues above really leave room for another project to take the good parts and not the bad ones, and steal Node's thunder. It could be Go or Python (with some badly needed extra work on coroutines, concurrency, performance/adoption of pypy, etc), or something new.
In Why I think Node.JS is a terrible platform
You lose expressiveness, you lose maintainability, you lose peace of mind, and you get speed. - I don't think my JS/CoffeeScript code is (significantly) less or more expressive and maintainable than the Python code I would have written. Use coffee if you want a whole bunch of language features, including some missing in Python. Oh, and a much cleaner way to write lambdas. - Yes you need to understand async. It is of course, increasingly relevant with services and devices talking to each other. For example, in Microsoft's WinRT anything taking more than 50ms has to be async by design. After a while you might even wonder why async isn't the default way of doing most I/O. - Flow control is hard in async, especially when you are getting started. But there are libraries which help, such as https://github.com/caolan/async. - The library approa
Read the rest
ch works for me and is a safer bet, but isn't the cleanest. If you are adventurous you could try iced-coffeescript, which introduces keywords to give you simpler code. - Finally, you need to have a really good grip on JS.
In Why I think Node.JS is a terrible platform
We use a whole bunch, some of the main ones: - async => helpful async library https://github.com/caolan/async - nodeinspector => node js debugging in a nice webkit UI https://github.com/dannycoates/node-inspector - riakjs => for talking to Riak: http://riakjs.org/ - knox => S3 helper https://github.com/LearnBoost/knox - optimist => helper lib for writing command line node apps (no more bash :) https://github.com/substack/node-optimist - mocha => unit testing node code https://github.com/visionmedia/mocha - emailjs => email helper https://github.com/eleith/emailjs - uglifyjs => code minification https://github.com/mishoo/UglifyJS
In Show HN: clipboard.com, the best way to save anything online
> The only technical problem where I've seen node be a unique solution is dealing with third party apis concurrently. Use a library like Async, it makes this really easy. https://github.com/caolan/async (assume redis, mongo, facebook, and callback are all functions) async.parallel([ redis, mongo, facebook], callback); callback is called when all of the others are complete. If you have dependencies, like facebook needs the output of redis and mongo then use async.auto which will automatically run things in parallel and in the order you need them.
In The love and hate of Node.js

Showing the 15 most recent of 21 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.