{"id":17484720,"url":"https://github.com/creationix/fastqueue","last_synced_at":"2025-04-10T02:43:27.071Z","repository":{"id":7808110,"uuid":"9178683","full_name":"creationix/fastqueue","owner":"creationix","description":"A fast push/shift sync queue","archived":false,"fork":false,"pushed_at":"2021-10-18T06:48:53.000Z","size":106,"stargazers_count":29,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T04:07:03.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creationix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-02T19:53:23.000Z","updated_at":"2024-07-15T08:33:00.000Z","dependencies_parsed_at":"2022-08-30T10:11:44.711Z","dependency_job_id":null,"html_url":"https://github.com/creationix/fastqueue","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Ffastqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Ffastqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Ffastqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Ffastqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/fastqueue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248145255,"owners_count":21055090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-19T01:05:55.964Z","updated_at":"2025-04-10T02:43:27.043Z","avatar_url":"https://github.com/creationix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"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 \u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Ffastqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Ffastqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Ffastqueue/lists"}