A simple, zero-dependency Node.js module that buffers items (objects, strings, numbers) until a maximum size is reached or a flush interval expires. Current stable version is 1.0.1. It is a small, flexible utility for batching operations with a configurable custom result function. Unlike more complex message queues, buffered-queue focuses on a minimal API with events and basic options, suitable for lightweight in-process buffering. Updates are infrequent, but the module is stable and has no known issues. It is primarily used in Node.js environments and does not support ESM natively, relying on CommonJS require().
npm install buffered-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a buffered queue with size 3 and 5s timeout, adds three items, and logs the flush event with processed data.
Always provide a name string as first argument, even if empty: new Queue('', {...})Ensure customResultFunction returns an array (or the desired data structure).
Review customResultFunction output to match expected format for flush event handling.
Use require('buffered-queue') instead of import.Ensure the Queue constructor is called with new and the returned object is assigned.
No dependency data recorded yet.