Simple promise-based function queue for rate-limited execution. Version 2.1.0, stable, with low release cadence. Each enqueued function resolves after a configurable interval from the previous function's resolution. Supports initial value passing between chained functions. Lightweight, no dependencies. Unlike throttle/debounce, it queues calls to ensure spacing but never drops them.
npm install queue-upNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue with 200ms interval and enqueues two async functions to demonstrate spacing.
Understand that long-running functions will cause subsequent functions to be delayed further. The total delay accumulates.
Always attach a .catch() to each queue.up() promise or handle errors inside the function.
Wrap the promise in an arrow function: queue.up(() => somePromise);
Use queue.up() instead of queue.enqueue().
Use const Queue = require('queue-up'); and then const queue = new Queue();Attach a catch handler: queue.up(fn).catch(err => console.error(err));
Ensure you pass a function reference or arrow function: queue.up(() => myAsyncFunction());
No dependency data recorded yet.