{"name":"tinyqueue","version":"2.0.0","description":"The smallest and simplest JavaScript priority queue","main":"tinyqueue.js","module":"index.js","jsdelivr":"tinyqueue.min.js","unpkg":"tinyqueue.min.js","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"},"files":["index.js","tinyqueue.js","tinyqueue.min.js"],"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.3.0","eslint-config-mourner":"^2.0.3","esm":"^3.0.74","rollup":"^0.64.1","rollup-plugin-buble":"^0.19.2","rollup-plugin-terser":"^1.0.1","tape":"^4.9.1"},"eslintConfig":{"extends":"mourner","parserOptions":{"sourceType":"module"},"rules":{"no-var":"error","prefer-const":"error"}},"gitHead":"ce85dbb0bcd1e1c19aa97ee150cf6834c322dc32","_id":"tinyqueue@2.0.0","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"integrity":"sha512-CuwAcoAyhS73YgUpTVWI6t/t2mo9zfqbxTbnu4B1U6QPPhq3mxMxywSbo3cWykan4cBkXBfE8F7qulYrNcsHyQ==","shasum":"8c40ceddd977bf133ffb35e903e0abe99d9d4e97","tarball":"http://registry-npm.ywwl.com/tinyqueue/download/tinyqueue-2.0.0.tgz","fileCount":6,"unpackedSize":8821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbazkxCRA9TVsSAnZWagAAD/UP/iQNXEiAgxFjy1ybLQQM\nnqtPMCm6ukgPhN4rndUjk0SaIVAmMsn6jDKn/jjfAXldBFz1I+5VUNS8I+eR\nYAsW7Ezb7XTiM/G8FVQfd2o9cNoPVeXD54bzTxIOC64QnFbt1C0aqhUnEayB\nPt+tSg8vo7t7Z0Fjh10JqgSHScHQmWceTJnZHsEFFuX/GAN+c34X6qPo1EX4\nZo2sbbFXYNynUKk93VdbE0BRvvT6q8vrJ9sskBLSGSMU8MAR4Ws4EQHYqKzs\nNAN5H0af5K/7r8nRRaFmz4Ic8zfM3ouZ63Hh7tUA3owFoQtTMrDzvFM0rg1h\nUEFhRkHvELnvwhbloAKBSK0vl5MUqcF7d7k3nA2Ttv+FhHbmljpPWpnAcRH4\nJyUL6PiuWFvlh6lo8PWi8NySY2lbx6pIOTW4M7bm1PRssEXDJuRC+JmR7vw0\nFMbIjMCvGI/RY4d7c1L2L2hx2ikYsXKAd61UkbxrCT6P5DbftrzOTaSs5MLE\nPchMEHM3D7EqoAiz62S4U6YLM+jHnk8ceMWTHA+OGUztI2SSD6jZUeZA19a0\nnugxZWKqau+7h1GywAvpLdXXnZHdFgBdrGMsxxOZJsXaC9TkoCrdhZoQXhlt\n0HG37ZaLqZC40k1LWNK3rJ0kuY46ExoB+f8QmKKrG5WuwgDt4moZP8b7ZYGq\n40w2\r\n=zHrg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA0Q5j21WqsoGMR7rvUcHGrxtmF3cY2nhQ+K8KpJC6I3AiB6X37rNNzrTHcJ4PEPcg9CLx1PNlLiF0W9V/WFXIJnkQ=="}],"size":3140,"noattachment":false,"key":"/tinyqueue/-/tinyqueue-2.0.0.tgz"},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tinyqueue_2.0.0_1533753648989_0.25339194984409863"},"_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":1533753649093,"_cnpm_publish_time":1533753649093,"dist-tags":{"latest":"3.0.0"}}