{"name":"tinyqueue","version":"3.0.0","description":"The smallest and simplest JavaScript priority queue","type":"module","main":"index.js","module":"index.js","types":"index.d.ts","scripts":{"lint":"eslint *.js","pretest":"npm run lint","test":"node --test","bench":"node bench.js","prepublishOnly":"npm test"},"repository":{"type":"git","url":"git+https://github.com/mourner/tinyqueue.git"},"keywords":["queue","priority","binary heap","data structures"],"author":"","license":"ISC","bugs":{"url":"https://github.com/mourner/tinyqueue/issues"},"homepage":"https://github.com/mourner/tinyqueue","devDependencies":{"eslint":"^9.6.0","eslint-config-mourner":"^4.0.1"},"_id":"tinyqueue@3.0.0","gitHead":"1f818719f6b048be781642f04bd84e061e0ecfd3","_nodeVersion":"20.15.0","_npmVersion":"10.8.0","dist":{"integrity":"sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==","shasum":"101ea761ccc81f979e29200929e78f1556e3661e","tarball":"http://registry-npm.ywwl.com/tinyqueue/download/tinyqueue-3.0.0.tgz","fileCount":5,"unpackedSize":4937,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEkXuVPX3av+W6SoU4umPJAgJJBqKckgrhBsasYbSMjyAiASkhxHx/JGcL/hLujLD3QYvbab5yAdr4C2X7FSaDxytw=="}],"size":2267,"noattachment":false,"key":"/tinyqueue/-/tinyqueue-3.0.0.tgz"},"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tinyqueue_3.0.0_1720256236237_0.9444778743433357"},"_hasShrinkwrap":false,"readme":"## tinyqueue\n\nThe smallest and simplest binary heap priority queue in JavaScript.\n\n```js\n// create an empty priority queue\nvar queue = new TinyQueue();\n\n// add some items\nqueue.push(7);\nqueue.push(5);\nqueue.push(10);\n\n// remove the top item\nvar top = queue.pop(); // returns 5\n\n// return the top item (without removal)\ntop = queue.peek(); // returns 7\n\n// get queue length\nqueue.length; // returns 2\n\n// create a priority queue from an existing array (modifies the array)\nqueue = new TinyQueue([7, 5, 10]);\n\n// pass a custom item comparator as a second argument\nqueue = new TinyQueue([{value: 5}, {value: 7}], function (a, b) {\n\treturn a.value - b.value;\n});\n\n// turn a queue into a sorted array\nvar array = [];\nwhile (queue.length) array.push(queue.pop());\n```\n\nFor a faster number-based queue, see [flatqueue](https://github.com/mourner/flatqueue).\n\n### Install\n\nInstall using NPM (`npm install tinyqueue`) or Yarn (`yarn add tinyqueue`), then:\n\n```js\n// import as an ES module\nimport TinyQueue from 'tinyqueue';\n\n// or require in Node / Browserify\nconst TinyQueue = require('tinyqueue');\n```\n\nOr use a browser build directly:\n\n```html\n<script src=\"https://unpkg.com/tinyqueue@2.0.0/tinyqueue.min.js\"></script>\n```\n\n### Thanks\n\nInspired by [js-priority-queue](https://github.com/adamhooper/js-priority-queue)\nby [Adam Hooper](https://github.com/adamhooper).\n","publish_time":1720256236411,"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_cnpm_publish_time":1720256236411,"dist-tags":{"latest":"3.0.0"}}