Tutorials
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
asyncio.gather runs many waiting tasks at once in one thread and returns results in order. Avoid await in a loop and blocking calls, keep failures with return_exceptions=True, and limit concurrency with a Semaphore.
Downloads spend most of their time waiting. ThreadPoolExecutor lets many waits overlap: 20 half-second downloads in 2 seconds instead of 10. Handle failures with as_completed, pick a sensible worker count and respect the server.
Send many requests, keep the successes, and report the failures instead of losing everything to one rejected promise. Plus limiting how many run at once.
fetch has no timeout option and can wait a very long time. AbortSignal.timeout(ms) fixes that in one line, and AbortSignal.any combines it with a cancel button.
Hide page numbers and "next" links inside an async generator, then loop over every record with for await. Stop early and the remaining pages are never fetched.
Add a user property to the Express request type with a module augmentation in one declaration file. After this, middleware and handlers agree on the type and you avoid the mistake that floods node_modules with errors.
Turn a route pattern into a type that finds the parameter names and checks the paths you pass. After this, a typo in a route or a missing parameter is a compile error.