{"id":16756785,"url":"https://github.com/charmander/array-queue","last_synced_at":"2025-10-03T19:32:13.808Z","repository":{"id":29236483,"uuid":"116836830","full_name":"charmander/array-queue","owner":"charmander","description":"A queue backed by an array","archived":false,"fork":false,"pushed_at":"2022-07-05T22:57:01.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-22T06:28:47.274Z","etag":null,"topics":["javascript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/array-queue","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charmander.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":"2018-01-09T15:52:58.000Z","updated_at":"2020-12-04T03:16:51.000Z","dependencies_parsed_at":"2022-07-27T18:04:24.608Z","dependency_job_id":null,"html_url":"https://github.com/charmander/array-queue","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/charmander%2Farray-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmander%2Farray-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmander%2Farray-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charmander%2Farray-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charmander","download_url":"https://codeload.github.com/charmander/array-queue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235176808,"owners_count":18948124,"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":["javascript"],"created_at":"2024-10-13T03:42:04.882Z","updated_at":"2025-10-03T19:32:08.424Z","avatar_url":"https://github.com/charmander.png","language":"JavaScript","readme":"A queue backed by an array. Like [double-ended-queue][], but single-ended.\n\n\n## Install\n\n```sh\nnpm install array-queue\n```\n\n\n## Example\n\n```javascript\nimport Queue from 'array-queue';\n\nconst queue = new Queue();\nqueue.enqueue(1);\nqueue.enqueue(2);\nconsole.log(queue.dequeue());  // 1\nconsole.log(queue.dequeue());  // 2\nconsole.log(queue.dequeue());  // Error: queue empty\n```\n\n\n## API\n\n- `new Queue()`\n\n    Creates an empty queue.\n\n- `queue.count`\n\n    The number of items in the queue.\n\n- `queue.enqueue(value)`\n\n    Adds a value to the end of the queue. Constant amortized time.\n\n- `queue.dequeue()`\n\n    Removes a value from the beginning of the queue and returns it. Throws an error if the queue is empty. Constant time.\n\n- `queue.tryDequeue()`\n\n    Like `dequeue()`, but returns `null` instead of throwing an error if the queue is empty.\n\n\n  [double-ended-queue]: https://www.npmjs.com/package/double-ended-queue\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmander%2Farray-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharmander%2Farray-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharmander%2Farray-queue/lists"}