{"name":"tinyqueue","version":"2.0.3","description":"The smallest and simplest JavaScript priority queue","main":"tinyqueue.js","module":"index.js","jsdelivr":"tinyqueue.min.js","unpkg":"tinyqueue.min.js","types":"index.d.ts","scripts":{"lint":"eslint index.js test.js bench.js rollup.config.js","pretest":"npm run lint","test":"tape -r esm test.js","bench":"node -r esm bench.js","build":"rollup -c","watch":"rollup -cw","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":"^5.16.0","eslint-config-mourner":"^3.0.0","esm":"^3.2.25","rollup":"^1.15.4","rollup-plugin-buble":"^0.19.6","rollup-plugin-terser":"^5.0.0","tape":"^4.10.2"},"eslintConfig":{"extends":"mourner"},"gitHead":"9dbd2aa55837588001c776115fa04b9bbafc404b","_id":"tinyqueue@2.0.3","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==","shasum":"64d8492ebf39e7801d7bd34062e29b45b2035f08","tarball":"http://registry-npm.ywwl.com/tinyqueue/download/tinyqueue-2.0.3.tgz","fileCount":7,"unpackedSize":8739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdA6kzCRA9TVsSAnZWagAAiGEP/AyBA8G8SwsjiET97LZh\nvUP4wrbtNtQ3flsVysiGySx4I1+crdSwTF7irqMN8tuvLsB9biMGlDv42h0a\nAgkYD+nYk2NkjKHYXFxQuTFetj4ohEgVNu3NasetkfYPbvPbU7rCCrPMm4Z2\nTH6kXvYRX76jBZKACb8JwJDXfgLttqrmqt+AbYKg2dmohjubUbOo5vYHEv8M\n8gHak1O89A/7Z+DxoksJGgC8skTKuyt2asiKah0c3YOjHmRKg7hYbfodLRKn\na5fRYXRJwp5bGIClU/YSdSV+KkO6utSPP7AOjo0uacx2L7GeuWC4jjnRMkGG\nb/9ddrq4vhqPwxoN6SArm8FbsDY2VfIW11+EPnySmlf0zKhWnZtdfwpuuvqz\nOdzAg3foyHpbROMsi+Ncd0jRur0EOExc25eowLMqBPk5vABOemamEu4gl6OR\nO+al/rPGStkdjuAMbhBObYDcsg1XxDq5V5jt/8ZnahW0Ojnjiy8uSMqewna5\nXyQwB5d5TjcMuI1xB41zRGUVLxvfuvPDO/56Q2KzZrBRMhIZ5LNVRfrsjEC2\noybNM/LeWc+P92inWVKrg8tRpWnyP/4BMvAGG0jE0xzQ+mKaxRzIgUcHonEk\nBVKQw68hWZDk1DJjVisZnGejM2J1QODFRKUQhQND+UovGptRdS9VH6AW/WUW\np8xw\r\n=5cME\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDorTkeV3Zuu7Ud3YQlx2j9L5IME9t0VpO2vj8nGP46zAIgG4RMs8QQLmwsqtSPI5nlKzEN56MkOz7JTWJiH/0O/ys="}],"size":3307,"noattachment":false,"key":"/tinyqueue/-/tinyqueue-2.0.3.tgz"},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tinyqueue_2.0.3_1560521010060_0.3224439344834469"},"_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":1560521010258,"_cnpm_publish_time":1560521010258,"dist-tags":{"latest":"3.0.0"}}