- Callback hellAs also for other styles, modularization and good names helps in readability.
- Async libraryThis library helps with increasing intendations and covers almost any use case. It is very useful at least to be aware of their options.
- Promises (ES6)It is different style then node.js (default) error first callbacks. Working with promises feels more natural (you get “async” result as result of function instead of passing callback argument, but YMMV). However for this reason this approach does not work directly with node.js API. You need to wrap the code or use other solutions like es6-promisify (which can have some limitations)
Another problem is inconsistent error handling however in node.js and chrome it seems to work fine.
- async/await (ES7)Still not standardized, you need babel or similar solution to make it working. Similar style to promises. We had some problems when we tried to use in in some high-order functions (but can’t remember anymore).
Till now there is no obvious winner and maybe future will show.