A Node.js library for queuing callbacks so that concurrent requests for the same resource are executed only once. Current stable version is 3.0.0. It allows you to deduplicate simultaneous calls to the same function (e.g., HTTP requests) by queuing callbacks under a key. Once the first call completes, all queued callbacks receive the result. Works in Node.js and browser via browserify. Lightweight and simple, with no external dependencies.
npm install callback-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates deduplication of concurrent HTTP requests using callback queue.
Always check if the return value is callable before using it as a callback.
Always pass an Error instance as the second argument to remove().
Use add() and remove() instead of put() and take().
Wrap in a Promise or use promisify from util.
Use const callbackQueue = require('callback-queue'); then callbackQueue.add() and callbackQueue.remove().Check if callback is truthy before using it: if (!callback) return;
Use CommonJS require: const callbackQueue = require('callback-queue');No dependency data recorded yet.