Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, I assumed there had to be libraries to do this already, but didn't come across anything that did what I wanted. I'll check out async though, thanks for the heads up.

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. Defer 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.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact