Rate-limit arbitrary asynchronous or synchronous code with a FIFO queue that drains at a controlled interval. Version 3.0.0 is current, actively maintained, and ships TypeScript definitions. Unlike lodash throttle, throttled-queue never drops executions — every call is queued and executed at the configured rate. Supports browser and Node.js, with optional even spacing and convenience helpers (seconds, minutes, hours). Breaking changes from v2: named import required, options passed as single object.
npm install throttled-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a throttle that allows up to 5 executions per second, with even spacing. Queues 20 requests; logs each with timestamp.
Use `import { throttledQueue } from 'throttled-queue'` and pass options as `{ maxPerInterval, interval, evenlySpaced }`.Use helpers like `seconds(1)` or pass `1000` explicitly for one second.
Consider whether even spacing is important; omit or set to `false` for immediate queuing.
Wrap in try/catch or attach .catch() to each throttled call.
Upgrade to v3 with the new options object syntax.
Change to `import { throttledQueue } from 'throttled-queue'`.Use `const { throttledQueue } = require('throttled-queue')`.Ensure interval is a number in milliseconds, e.g., `interval: 1000` or `interval: seconds(1)`.
Use a positive integer like `maxPerInterval: 5`.
No dependency data recorded yet.