bucket-queue v1.0.1 is a minimal Node.js promise queue implementing leaky bucket throttling. It is ideal for rate-limiting API calls to services like Shopify or GitHub. The package is stable but low maintenance (last release 2016, repository archived). It enforces max calls per time window, concurrency limits, and tick-based state updates. Only 10 JavaScript (no types) and CommonJS. Alternatives: p-limit, bottleneck, p-queue (more features and active maintenance).
npm install bucket-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a leaky bucket queue, adding promise-returning tasks (fetch), and inspecting state.
Replace with p-limit, bottleneck, or p-queue.
Set calls slightly lower than actual limit to account for burst, or use a different library with better initial bucket state.
Keep default or adjust based on your interval length (e.g., 100 ms for 60s windows).
Always pass a function: q.add(() => fetch(url)) rather than q.add(fetch(url)).
Use q.getState().waiting to avoid confusion.
Use: const q = BucketQueue(options); (call the function)
Use default import: import BucketQueue from 'bucket-queue';
Run `npm install bucket-queue` or upgrade Node.
No dependency data recorded yet.