Async + Await
summary
Explains why async/await gives synchronous-looking, nonblocking JavaScript and demonstrates concrete patterns: using Promise.all to parallelize two Axios fetches, an example sleep promise, error strategies including try/catch, a higher‑order catchErrors wrapper that forwards exceptions to Express next, and listening for process unhandledRejection. Shows converting callback APIs with util.promisify, measures that parallel requests finish in the longer of the two timings, and confirms the wrapper approach cleanly captures thrown errors and passes them into Express error middleware.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:00Why Await
- 3:22Browser APIs
- 3:46Promises
- 5:40JavaScript vs PHP
- 6:38Await Function
- 8:25Trycatch
- 9:07HandleError
- 10:03How it works
- 11:05Express
- 12:23Implementation
- 12:52Handle the error
- 13:19Unhandled rejection
- 14:21Tips
related talks
33mAsync Functions Awaiting You
47mThere and back again Understanding Async Await
41mNext Generation Asynchronous Patterns in JavaScript
25mThe 80 20 Guide to Async Await
49mA Beginner's Guide to Wrangling Asynchronicity in JavaScript
01h 00mJavascript Promises vs async-await
42mBeyond Promises: Async Patterns in JavaScript
14mThe Promised Path to Async, Awaits
