Async JavaScript, properly

5 posts · 19 min, best read in order

Timers, loops, batching and cancellation: how asynchronous code actually schedules, and the patterns that quietly go wrong.

  1. 1 Guide to Nodejs Timers: setTimeout, setImmediate & nextTick 2 minExplore Node.js timers and process.nextTick with this simplified guide. Understand how to use setTimeout, setImmediate, and nextTick effectively.
  2. 2 The Pitfalls of Using Async/Await Inside forEach() Loops 3 minRunning async operations with .forEach() can be tricky. Sometimes it might not work as expected. Explore better alternatives for async tasks in arrays
  3. 3 Promise.all() Is Fine... Until It Isn’t! 6 minLearn why Promise.all() fails at scale and how a batch executor ensures controlled concurrency with timeouts and graceful error handling in Node.js.
  4. 4 Harnessing the Power of Top-Level await() without async() 4 minDiscover the power of top-level await() in modern Node.js. Learn how it simplifies asynchronous code and explore its benefits for cleaner development.
  5. 5 Async Operations with AbortController & AbortSignal in Nodejs 4 minAvoid delays in Node.js applications with AbortController. Learn how to abort long-running operations when interacting with APIs, networks, and databases.