Heap.js

JSON →
library 0.2.7 ·javascript maintenance
verified Jun 7, 2026

A binary heap (priority queue) implementation in CoffeeScript/JavaScript, ported from Python's heapq module. Current stable version is 0.2.7 (last released in 2013). No release cadence; maintenance-only mode. Key differentiator: simple API with both instance methods (push, pop, peek) and static methods for arrays, plus nlargest/nsmallest utilities. Alternatives like `flatqueue` or `tinyqueue` may offer better performance or modern features.