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

18 sources
You misunderstand me, I think. Callback spaghetti is different from complex code that uses lots of callbacks. I'm not saying you don't need to have a series of nested callbacks to do things, I'm saying you should hide these behind the appropriate abstractions for the task you're writing. In your case the bullet points listed are exactly those layers of abstraction. The request handler processes the form and calls the S3 layer for each file. The S3 layer then calls the APIs and passes off the responses to the XML parsing layer - which gives it back a useful JS object detailing the response, the API layer then provides a response to the request handler which formats the response and sends it to the client. The workflow I'm implementing in Node is even more complicated than this, but good use of abstractions and control flow libraries[1] mea
Read the rest
ns that it's extremely rare for any code to be indented more than 5 blocks. [1] https://github.com/caolan/async is my lib of choice, but plenty of other suitable choices exist.
In Fixing the callback spaghetti in node.js
In the node.js project I just finished, I was also forced to write some "async" c# for a separate system that the node.js project communicated with. Now, I'll be the first to admit, I don't know c#... but, it was the first time I had used both node.js AND c#. I have to say, the c# approach was a horrible exercise in pain and agony. I started to run into significant nesting in node.js, then realized it was because my approach was flawed. I abstracted more, and I also started using async.js (https://github.com/caolan/async), and everything was well in the world.
In Fixing the callback spaghetti in node.js
It's not an inflammatory blog post. The headline might be a little annoying to some, but not to most of us. There are negative headlines about every programming language platform. Also it's a reminder for Node.js developers to make good use of async patterns, lest their code look silly. Besides async, which Fenn mentions in the comments, there's EventEmitters and Backbone.js for doing different styles of async programming. And there are a few other libraries that are a lot like https://github.com/caolan/async .
In Node.js - A Giant Step Backwards
Nice article. Be sure to read the comments, as the author links to a library that makes the second example easy to rewrite in a short and elegant way. https://github.com/caolan/async#forEach Also the first example, the cache hitting and missing, could be rewritten with async, too. async.waterfall([ function(callback) { asynchronousCache.get("id:3244", callback); }, function(myThing, callback) { if (myThing == null) { asynchronousDB.query("SELECT * from something WHERE id = 3244", callback) } else { callback(myThing) } }, function(myThing, callback) { // We now have a thing from the DB or cache, do something with result // ... } ]);
In Node.js - A Giant Step Backwards
I'm the author of the Async JavaScript library (http://github.com/caolan/async) and kept finding myself including it with the excellent Underscore.js for small and client-side projects. This seemed like overkill, so I've made a tiny build with just the essentials from each library, and a new unified API. Perhaps some HN members will find this useful?
In [dead]
There are many many attempts at solving this problem, both libraries and preprocessors. None seem to satisfy a large audience, most people seem to deal with the callback nesting and hope to avoid cases where it gets super ugly. I have a lot bookmarked on github, these are mostly libraries. https://github.com/coolaj86/futures https://github.com/substack/node-seq https://github.com/marcuswestin/fun https://github.com/creationix/step https://github.com/chriso/chain.js https://github.com/substack/node-chainsaw https://github.com/caolan/async https://github.com/kriszyp/promised-io https://github.com/kriszyp/node-promise https://github.com/technoweenie/node-chain-gang https://github.com/creationix/do https://github.com/willconant/flow-js https://github.com/creationix/conductor Some branches of CoffeeScript are also trying to ease the pain. Defe
Read the rest
r keyword didn't make it into CoffeeScript main. My impression is CoffeeScript makes callback hell less ugly anyway, so there is less need for adding a complex language feature that generates unreadable JavaScript.
In Three Routes to Spaghetti-Free Javascript
It's been done. One of the best libraries for managing asynchronous code in JS without hiding it away is http://github.com/caolan/async I agree wholeheartedly, by the way. There's way too much scope for leaky abstractions when you try to hide away the true nature of asynchronous code. Same reason, I think, why most people are lukewarm about using continuations in web development, like e.g. Seaside does: in principle, very neat, very clean, but it hides away a fundamental aspect of how the web works, which can lead to all sorts of unforeseen behavior re. caching, debugging et cetera.
In Three Routes to Spaghetti-Free Javascript

Showing the 15 most recent of 18 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.