A minimal Priority Queue implementation for Node.js and browser, offering push/top/pop operations with numeric priorities, optional custom compare function, and queue size limit. Version 0.3.1 (last release ~2012) targets Node ~0.8, no updates since, and lacks features like TypeScript types or ESM support. It is a bare-bones alternative to more modern and maintained priority queue libraries.
npm install pqueueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of PriorityQueue with push() and top() operations and priority ordering.
Migrate to a maintained alternative like 'priorityqueue' or 'flatqueue'.
Use var { PriorityQueue } = require('pqueue'); or require('pqueue').PriorityQueue.Always provide a priority as second argument: queue.push(element, priority).
Add a .d.ts file: declare module 'pqueue' { export class PriorityQueue { push(element: any, priority: number): void; top(): any; pop(): any; } }Use dynamic import or configure bundler to handle CommonJS modules.
Use var { PriorityQueue } = require('pqueue'); then new PriorityQueue().Run npm install pqueue. Note: package is abandoned and may not install on modern Node versions without --legacy-peer-deps.
No dependency data recorded yet.