queue-priority
Simple priority Queue implementation.
Last updated 10 years ago by augustohp .
Repository · Bugs · Original npm · Tarball · package.json
$ npm install queue-priority 
SYNC missed versions from official npm registry.

Priority Queue (NodeJS) Build Status

It's a simple implementation of a PriorityQueue for NodeJS. As the code is JavaScript it could be used on the browser without any trouble.

The basic usage is to push() elements and give them a priority to be used into the queue. You can also set a custom compare() function and a limit of elements to be held into the queue.

More examples can be found into the tests folder.

queue = new PriorityQueue();
queue.push("Most important note", 99);
queue.push("Important note", 50);
queue.push("Silly notice", 1);

queue.top(); // Most important note
queue.top(); // Important note
queue.top(); // Silly notice
queue.top(); // undefined

Current Tags

  • 1.0.0                                ...           latest (10 years ago)

1 Versions

  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE