A priority queue that shuffles elements with the same priority. Current stable version is 2.1.0. The package is lightweight and provides a simple API for adding, removing, shifting, popping, and iterating over items. It is suitable for scenarios where elements of equal priority should be processed in a random order, such as load balancing or fair scheduling. The package is actively maintained and has no external dependencies.
npm install shuffled-priority-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: creating a queue, adding items with priorities, and shifting items. Items with same priority are shuffled.
Always set a numeric `priority` on objects passed to `add()`, or handle items without priority separately.
Review code that uses `next` or `prev` iteration if upgrading from v1 to v2.
Use `const queue = spq()` (no `new` keyword).
Run `npm install shuffled-priority-queue`.
No dependency data recorded yet.