{"_id":"priorityqueuejs","_rev":"16-f67391b11240d4ac55244a781df92467","name":"priorityqueuejs","description":"a simple priority queue data structure","dist-tags":{"latest":"2.0.0"},"versions":{"0.0.1":{"name":"priorityqueuejs","version":"0.0.1","description":"a simple priority queue data structure","author":{"name":"Jano González","email":"info@janogonzalez.com"},"devDependencies":{"mocha":"*","should":"*"},"main":"index.js","dependencies":{},"scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"keywords":["heap","queue","priorityqueue","datastructure"],"license":"MIT","_id":"priorityqueuejs@0.0.1","dist":{"shasum":"fa9379c96c35f670dad12e222c15497fe4bcd2be","tarball":"https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-0.0.1.tgz","integrity":"sha512-qI2BLrMMoD/45ETvF1Ztx1pu/l4B5Fr/djeHp+wK6NDsM9lfGv7pbkVUJ8uVOHZRIrAGAlYiBtML72oaLZqXqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAz/Xl+Brimh+Kx8Rf/eXCOf0G7NRWof54kTOVpeMsn3AiEAmNmG2X4xtyZLJbx7D85st4kPgoTtqRxjHzf6FrrW1mE="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"janogonzalez","email":"info@janogonzalez.com"},"maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"directories":{}},"0.0.2":{"name":"priorityqueuejs","version":"0.0.2","description":"a simple priority queue data structure","author":{"name":"Jano González","email":"info@janogonzalez.com"},"devDependencies":{"mocha":"*","expect.js":"*"},"main":"index.js","dependencies":{},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"keywords":["heap","priority","queue","priorityqueue","datastructure"],"license":"MIT","_id":"priorityqueuejs@0.0.2","dist":{"shasum":"74c29e55157e223281e0c222c05b35a114c20f54","tarball":"https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-0.0.2.tgz","integrity":"sha512-CMrHRN8V2WStedaH5UWMUrkvrYtj6yxtFAgCulEA1a+GuerTDPVEmqyxtgSpnsj9VWjhd6PBPXxQ8hx9kmoKuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCc8XdTcrHny+2b3kSQkcc1QOQ1I5fHJrDoIDdIMjdhkAIhALL7eiyYvaaAxiQdtdjAUprHpIcPs5K/6tLuhsntqnDD"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"janogonzalez","email":"info@janogonzalez.com"},"maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"directories":{}},"0.1.0":{"name":"priorityqueuejs","version":"0.1.0","description":"a simple priority queue data structure","author":{"name":"Jano González","email":"info@janogonzalez.com"},"devDependencies":{"mocha":"*","expect.js":"*"},"main":"index.js","dependencies":{},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"keywords":["heap","priority","queue","priority queue","data structure"],"license":"MIT","_id":"priorityqueuejs@0.1.0","dist":{"shasum":"417b7e6e1baa5d1379a92702fff9bee479d34c05","tarball":"https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-0.1.0.tgz","integrity":"sha512-kbXmnA2ufp644NChdUv49w0k2Wsj0azvxCyw6riuKmiZiXoN7bhc9bxmxKQqoZ+CFn2Rv8iLfMthtYfSxYajVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE0OKb3wyNiCzAwGxvDBIJfhM0tDt9sjH7v0is0eyRPwAiAGQmvEiu1aqfSgc5o/n96zGumRKQxby1uDUgyKkdYBxA=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"janogonzalez","email":"info@janogonzalez.com"},"maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"directories":{}},"0.2.0":{"name":"priorityqueuejs","version":"0.2.0","description":"a simple priority queue data structure","author":{"name":"Jano González","email":"info@janogonzalez.com"},"devDependencies":{"mocha":"*","expect.js":"*"},"main":"index.js","dependencies":{},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"keywords":["heap","priority","queue","priority queue","data structure"],"license":"MIT","bugs":{"url":"https://github.com/janogonzalez/priorityqueuejs/issues"},"homepage":"https://github.com/janogonzalez/priorityqueuejs","_id":"priorityqueuejs@0.2.0","dist":{"shasum":"105ec881f21f0789a8f936aaff0761a9dc6390b0","tarball":"https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-0.2.0.tgz","integrity":"sha512-HVTAzP6YsnV2Az45xFNF4Rtmobtr2+3A9As5tvJVo8ivwc3qIgHEh6RHpecUCP2MmJHlL/oBHoHcshWT2CxTrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjFqRZE6Ux5753gvxRQ8zTaSNMWcVlfxdDzFxsDbWQYgIgFY7FKaGQhyXMcqx0KNCtC5FyTY0UIm7L8ZRs/ONfTSk="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"janogonzalez","email":"info@janogonzalez.com"},"maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"directories":{}},"1.0.0":{"name":"priorityqueuejs","version":"1.0.0","description":"a simple priority queue data structure","author":{"name":"Jano González","email":"info@janogonzalez.com"},"devDependencies":{"mocha":"*","expect.js":"*"},"main":"index.js","dependencies":{},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"keywords":["heap","priority","queue","priority queue","data structure"],"license":"MIT","gitHead":"9a4c0483444248e2a41b64b8a528e1371bf7299d","bugs":{"url":"https://github.com/janogonzalez/priorityqueuejs/issues"},"homepage":"https://github.com/janogonzalez/priorityqueuejs","_id":"priorityqueuejs@1.0.0","_shasum":"2ee4f23c2560913e08c07ce5ccdd6de3df2c5af8","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"janogonzalez","email":"info@janogonzalez.com"},"maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"dist":{"shasum":"2ee4f23c2560913e08c07ce5ccdd6de3df2c5af8","tarball":"https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-1.0.0.tgz","integrity":"sha512-lg++21mreCEOuGWTbO5DnJKAdxfjrdN0S9ysoW9SzdSJvbkWpkaDdpG/cdsPCsEnoLUwmd9m3WcZhngW7yKA2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJPhpkSXEecrhod/J0UgYGw8p1CNxuiILI6sJg99LG8QIgMN7X41RJZNY/F3TM/96XlbalNPBbW2BG1FmkqdH4H/Y="}]},"directories":{}},"2.0.0":{"name":"priorityqueuejs","version":"2.0.0","description":"a simple priority queue data structure","author":{"name":"Jano González","email":"info@janogonzalez.com"},"devDependencies":{"mocha":"*","expect.js":"*"},"main":"index.js","dependencies":{},"scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"keywords":["heap","priority","queue","priority queue","data structure"],"license":"MIT","gitHead":"5fc8ac2ea0482277ee8110182e1d743e31cef1aa","bugs":{"url":"https://github.com/janogonzalez/priorityqueuejs/issues"},"homepage":"https://github.com/janogonzalez/priorityqueuejs#readme","_id":"priorityqueuejs@2.0.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-19BMarhgpq3x4ccvVi8k2QpJZcymo/iFUcrhPd4V96kYGovOdTsWwy7fxChYi4QY+m2EnGBWSX9Buakz+tWNQQ==","shasum":"96064040edd847ee9dd3013d8e16297399a6bd4f","tarball":"https://registry.npmjs.org/priorityqueuejs/-/priorityqueuejs-2.0.0.tgz","fileCount":6,"unpackedSize":13756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetDwBCRA9TVsSAnZWagAA3NUQAIiQ6gOs7vv1bCKp2IHf\nb/o5GxeuuwJLzFh6olvwwQvh3jNluTbhutqM8DPBvIzPMTeDzrE4zPeGm6d8\nAMegQSJSqp1sqfYbdd4kwX3sKcdRva1KVYeHFygFYYoouCCdOHB8IWnuiv/Z\nr5sIDeDlDOzu56CqMa8t/1l2vIFu0LJdP4UjdzlJBuHu+04UKJOe8/t+nvwH\n+jb51JE5npJmiM/rg1LLoRPkAAtF0mdZH4YpqjFszqlPFj0WfbfoZeZ/Q5nZ\n/5JBOlhhgR51ziT8+g7qOaeTot9qgcnvhWemzEslHSR7pvyD+K9J0QoLZ6P+\n96p8ExmyRbNEQdX2efZMad/8l8qRgLr7oSRiEjjrX2T6nJQ8N5nPBKN2U11W\nKXBmS2dpNENURCn5BxAwlT19CQZtH1wcZnMP/dP7+VctM51NZ3piGRjEj7ZN\nHaI5Zj08EV9R0T67IAVbhEMMGHarHlcAJQt89f3IdJLxz0BTw7COCzdzx6Dq\n+vGaSmoqSqHBGhKkoJMDUrymMIoWjxZJ22ekj4fw88Bt+8JUnijSgnrGyaD/\nOYCfaEiZU3jr5uprGoRiB7O0huBT6NFMvis7y8G60NQdlIx8PMy7pp8DkO8v\njQoPdGyvIJqhW+Cej/L9nJpwsbBByNq5nCrkByqHMseDM14W9uvolscTWfmg\njUou\r\n=8k51\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAadyzUu/5ROonudNa4gsYFX6B8O7c/fwJKxDzw0kKhfAiEAsQOFw10XkO87IwhTAejm8YADw+8Kohv1DRacEygEIEM="}]},"maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"_npmUser":{"name":"janogonzalez","email":"info@janogonzalez.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/priorityqueuejs_2.0.0_1588870144856_0.7385233620141971"},"_hasShrinkwrap":false}},"readme":"# priorityqueue.js\n\n[![Build Status](https://travis-ci.com/janogonzalez/priorityqueuejs.svg?branch=master)](\n  https://travis-ci.com/janogonzalez/priorityqueuejs)\n\nA simple priority queue data structure for Node.js.\n\n## Installation\n\n```\n$ npm install priorityqueuejs\n```\n\n## Example\n\n```js\nvar PriorityQueue = require('priorityqueuejs');\n\nvar queue = new PriorityQueue(function(a, b) {\n  return a.cash - b.cash;\n});\n\nqueue.enq({ cash: 250, name: 'Valentina' });\nqueue.enq({ cash: 300, name: 'Jano' });\nqueue.enq({ cash: 150, name: 'Fran' });\nqueue.size(); // 3\nqueue.peek(); // { cash: 300, name: 'Jano' }\nqueue.deq(); // { cash: 300, name: 'Jano' }\nqueue.size(); // 2\n```\n\n## API\n\n### `PriorityQueue()`\n\nInitializes a new empty `PriorityQueue` wich uses `.DEFAULT_COMPARATOR()` as\nthe comparator function for its elements.\n\n### `PriorityQueue(comparator)`\n\nInitializes a new empty `PriorityQueue` with uses the given `comparator(a, b)`\nfunction as the comparator for its elements.\n\nThe comparator function must return a positive number when `a > b`, 0 when\n`a == b` and a negative number when `a < b`.\n\n### `PriorityQueue.DEFAULT_COMPARATOR(a, b)`\n\nCompares two `Number` or `String` objects.\n\n### `PriorityQueue#deq()`\n\nDequeues the top element of the priority queue.\nThrows an `Error` when the queue is empty.\n\n### `PriorityQueue#enq(element)`\n\nEnqueues the `element` at the priority queue and returns its new size.\n\n### `PriorityQueue#forEach(fn)`\n\nExecutes `fn` on each element. Just be careful to not modify the priorities,\nsince the queue won't reorder itself.\n\n### `PriorityQueue#isEmpty()`\n\nReturns whether the priority queue is empty or not.\n\n### `PriorityQueue#peek()`\n\nPeeks at the top element of the priority queue.\nThrows an `Error` when the queue is empty.\n\n### `PriorityQueue#size()`\n\nReturns the size of the priority queue.\n\n## Testing\n\n```\n$ npm install\n$ npm test\n```\n\n## Licence\n\nMIT\n","maintainers":[{"name":"janogonzalez","email":"info@janogonzalez.com"}],"time":{"modified":"2022-06-24T16:14:04.641Z","created":"2013-03-02T00:55:31.294Z","0.0.1":"2013-03-02T00:55:33.194Z","0.0.2":"2013-03-02T18:47:29.866Z","0.1.0":"2013-03-04T00:17:17.328Z","0.2.0":"2014-02-06T12:02:38.749Z","1.0.0":"2015-02-23T17:22:03.717Z","2.0.0":"2020-05-07T16:49:04.963Z"},"author":{"name":"Jano González","email":"info@janogonzalez.com"},"repository":{"type":"git","url":"git://github.com/janogonzalez/priorityqueuejs.git"},"readmeFilename":"README.md","users":{"learnshiva":true},"homepage":"https://github.com/janogonzalez/priorityqueuejs#readme","keywords":["heap","priority","queue","priority queue","data structure"],"bugs":{"url":"https://github.com/janogonzalez/priorityqueuejs/issues"},"license":"MIT"}