From Promises through Generators to async/await in node.js
summary
An end-to-end code demonstration converting a Node.js HTTP handler through four styles: callbacks, ES6 Promises, generator-based (co-style), and ES7 async/await. It shows the specific shim/wrapper used, which Node APIs are invoked, live code and tests, plus a simple benchmark comparing throughput and lines of boilerplate (async/await yields similar throughput, less nesting, ~30% fewer boilerplate lines), with all versions passing the same integration tests.
AI-written summary · about
chapters (8)
- 0:00Async patterns in Node.js
- 3:02JavaScript promises basics
- 7:25Promises to generators
- 10:00Generators and async/await
- 13:19Async/await simplifies promises
- 16:03Async/await use cases
- 19:10Callbacks vs promises vs async/await
- 21:11Q&A
related talks
25mThe Long Road to Async/Await in JavaScript
45mNext Generation Asynchronous Patterns in JavaScript
42mBeyond Promises: Async Patterns in JavaScript
14mThe Promised Path to Async, Awaits
31mPromises and Generators: control flow utopia
32mJavaScript 7: the Evolution of JavaScript
32mPromises Are So Passé
33mAsync Functions Awaiting You
