Priority Blocking Queue

JSON →
library 1.0.1 ·javascript
verified Jun 7, 2026

A simple asynchronous priority queue for Node.js (v1.0.1). Items are inserted in sorted order using a custom comparator (default descending). The take() method returns a Promise that resolves to the next highest-priority item, blocking if the queue is empty until an item is put. Supports multiple blocked takers. Lightweight, no dependencies, CJS only. Differentiators: minimal API (put/take/size/takersBlocked), comparator is maximum-oriented (item with largest comparator value is taken first). Not compatible with ESM imports.