r/javascript • u/Khabib_Balrog • 2h ago
Typescript/React
github.comHow to make this game better ?
r/javascript • u/subredditsummarybot • 19h ago
Monday, October 19 - Sunday, October 25, 2026
| score | comments | title & link |
|---|---|---|
| 0 | 13 comments | made a CLI that generates a typed client from a HAR capture β here's what the output looks like |
| 0 | 10 comments | HTML is Alive - an exhortation to remove its ventilator |
| 0 | 5 comments | [AskJS] [AskJS] :Recently got a PR merged into TanStack Query |
| 0 | 4 comments | Article: I replaced EsLint. The First Attempt Worked. I threw it away. |
| 3 | 4 comments | Knitting β a shared-memory concurrency runtime for JavaScript |
r/javascript • u/Khabib_Balrog • 2h ago
How to make this game better ?
r/javascript • u/swif_dev • 5h ago
When you scale a Node.js backend using node:cluster, you run into a surprisingly annoying problem:
How do you rate-limit external APIs like Stripe or OpenAI while making sure all workers share the same rate limit?
The first solution that comes to mind is usually: "Just use Redis."
But does it really make sense to introduce additional infrastructure complexity, network overhead, and an entire external dependency just to coordinate a few API calls coming from the same server?
That's exactly why I built cluster-rate-limiter.
A Node.js library that gives you coordinated rate limiting across workers, powered entirely by Node.js's native IPC messaging, with no Redis and absolutely zero external dependencies.
Rather than diving into the internals here, here's what you get out of the box:
run() method accepts your fetch call or any function directly, along with all its arguments. No complicated callback patterns.429 Too Many Requests response.And when it comes to performance, the core data structure for tracking request timestamps uses a zero-allocation approach built around a Float64Array ring buffer.
This eliminates the need for repeated array reallocations and significantly reduces garbage collection pressure under heavy load.
If you're interested in the low-level details, I've explained the ring buffer implementation and how it reduces memory overhead in the README.
If you're running a clustered Node.js backend and want to avoid the overhead of introducing Redis just for rate limiting, check out the links below, explore the architecture, and let me know what you think!