{"dist":{"shasum":"6c691016b3806186476eeb05a717babb8f633c19","tarball":"https://registry.npmjs.org/fastqueue/-/fastqueue-0.1.0.tgz","integrity":"sha512-LLnJ2SwDHvX6XVAhOv3tJJegon1maeXLpnhEq0LSfUSW2GziksHb1EQcEWUzjh5tGbT4qa7jw6z737PhVpdmag==","signatures":[{"sig":"MEYCIQCslFb77Dqgf0Ur5tFbGXtHhKwonjfaJOeciHgh9t2HlQIhANA+sYo5lGlnfLBqzc2ss3GKnt57o7CtrSA5lPZoQR+w","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"queue.js","name":"fastqueue","_from":".","readme":"# Fast Queue\n\nWhile normal JavaScript arrays can be used as FIFO queues, the `.shift()` call is very slow if the queue gets large because it has to reindex all the remaining items on every shift.\n\nThis library is a fast queue that only implements `.push(item)`, `.shift()`, `.unshift(item)` and `.length` from the Array interface.\n\nInternally it uses two arrays and cycles them and uses counters so that the `.shift()` calls are still fast.\n\n## Usage\n\n```js\nvar Queue = require('fastqueue');\n\nvar q = new Queue;\nq.push(1);\nq.push(2);\nq.push(3);\nvar i = 4;\nwhile (q.length > 0) {\n  console.log(q.length, q.shift());\n  q.unshift(i++);\n  console.log(q.length, q.shift());\n  q.push(i++);\n  console.log(q.length, q.shift());\n}\n```\n","_npmUser":{"name":"creationix","email":"tim@creationix.com"},"_npmVersion":"1.2.15","description":"A fast push/shift sync queue","maintainers":[{"name":"creationix","email":"tim@creationix.com"}],"readmeFilename":"README.md","_id":"fastqueue@0.1.0","version":"0.1.0"}