{"repo":"natesilva/p-ratelimit","free":true,"listed":false,"github":"https://github.com/natesilva/p-ratelimit","clone":"git clone https://github.com/natesilva/p-ratelimit.git","description":"Promise-based utility to make sure you don’t call rate-limited APIs too quickly.","language":"TypeScript","stars":71,"topics":["promise","redis","rate-limiting","concurrency","distributed-systems"],"license":"MIT","category":"databases-storage","readme_excerpt":"p-ratelimit Makes sure you don’t call rate-limited APIs too quickly. This is an easy-to-use utility for calling rate-limited APIs. It will prevent you from exceeding rate limits by queueing requests that would go over your rate limit quota. Rate-limits can be applied across multiple servers if you use Redis. It works with any API function that returns a Promise. Install What’s different True rate limiting Utilities like p-limit control how many functions are running concurrently. That won’t prevent you from exceeding limits on APIs that use token-bucket throttling. p-ratelimit supports both concurrency and rate limits. Works across API families Utilities like Lodash throttle create separate quotas for each API function. p-ratelimit can enforce a single shared quota for all functions in an API family. Minimal implementation Utilities like limiter provide low-level tooling that requires you to manage tokens and provide your own queue. p-ratelimit requires minimal modification to your existing code. Distributed rate limits If you use Redis, p-ratelimit supports efficient rate limiting across multiple hosts. The quota is divided among your pool of servers. As servers are added or removed, the shared quota is recaclulated. Made for Promises and TypeScript friendly A rate-limited function returns the same Promise type as the original function. Example Configuration The Quota configuration object passed to pRateLimit offers the following configuration settings: If you care about rat","default_branch":null,"files":null,"tree":[],"storefront":"/r/natesilva","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/natesilva/p-ratelimit/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}