The Promise.all-vs-allSettled distinction is the one I'd tattoo on new hires — one bad request shouldn't take the other nine down with it, and yet the default reads like it should.
The adjacent pitfall I keep hitting is at the boundary rather than in the code: firing a dozen parallel fetches at raw GitHub URLs, which aren't served with sane caching and will happily rate-limit you mid-burst. I wrote a tiny thing that rewrites a GitHub blob URL into a proper CDN URL so those requests behave like static assets instead of API calls: https://github.com/p32929/ghcdn
The allSettled point deserves more airtime than it gets — most "random" production failures I've debugged were just one rejected promise quietly taking down a Promise.all that had no business being all-or-nothing. The sequential-vs-parallel await section is the one I'd staple to a wall, since awaiting inside a for-loop is somehow still the default reflex. Related trap: people reach for a real database purely to avoid managing concurrent writes to a file, which is why I keep a tiny JSON store around for small NodeJS things instead — https://github.com/p32929/fjsondb.
It's a joy to read great articles like this that clearly explains JS concepts amidst the unrelated AI slops polluting the internet.
Thank you for sharing.
Thank you :)
The Promise.all-vs-allSettled distinction is the one I'd tattoo on new hires — one bad request shouldn't take the other nine down with it, and yet the default reads like it should.
The adjacent pitfall I keep hitting is at the boundary rather than in the code: firing a dozen parallel fetches at raw GitHub URLs, which aren't served with sane caching and will happily rate-limit you mid-burst. I wrote a tiny thing that rewrites a GitHub blob URL into a proper CDN URL so those requests behave like static assets instead of API calls: https://github.com/p32929/ghcdn
The allSettled point deserves more airtime than it gets — most "random" production failures I've debugged were just one rejected promise quietly taking down a Promise.all that had no business being all-or-nothing. The sequential-vs-parallel await section is the one I'd staple to a wall, since awaiting inside a for-loop is somehow still the default reflex. Related trap: people reach for a real database purely to avoid managing concurrent writes to a file, which is why I keep a tiny JSON store around for small NodeJS things instead — https://github.com/p32929/fjsondb.