🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

prioqueuejs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prioqueuejs

Priority Queue implementation in typescript.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Prioqueuejs

Priority Queue implementation in typescript.

Getting started

npm install prioqueuejs

Usage

import { PrioQueue, CreateIterator } from "prioqueue";

// initializing with new values
const initialValues = [3, 4, 5];
const queue = new PrioQueue({
  compareFn: (a, b) => a - b,
  initialValues,
});

// Enqueueing new items
queue.enqueue(12);
queue.enqueue(1);
queue.enqueue(34);

queue.dequeue(); // returns 1
queue.dequeue(); // returns 3

// Using the Iterator
const iterator = CreateIterator(queue);
iterator.next(); // {value: 3, done: false}

// that also means you could use it in a loop
// which will exhaust the iterator and dequeue all
// items from the priority queue

for (const item of iterator) {
  console.log(item);
}

// Prints:
// 5
// 12
// 34

License

MIT

FAQs

Package last updated on 13 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts