qheap is a fast binary heap / priority queue library for Node.js (v1.4.0, stable, low release cadence). It supports insert, remove, peek, and heap operations with O(log n) complexity. Compared to alternatives like fastpriorityqueue, qheap offers good performance and a simple API. Primary use cases include scheduling, event loops, and Graph algorithms. The package is pure JavaScript without native bindings, making it portable across platforms.
npm install qheapNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a heap, insert items, remove the smallest, peek at the next, and check length.
Read length only; do not assign.
Use compar or comparBefore option: new Heap({ comparBefore: (a,b) => a > b })Use gc() manually or enable freeSpace option on construction.
Use require('qheap') in CommonJS.Use const Heap = require('qheap'); const h = new Heap();No dependency data recorded yet.