{"id":20285824,"url":"https://github.com/tpkn/queuem","last_synced_at":"2026-05-29T01:32:35.640Z","repository":{"id":74204176,"uuid":"125574378","full_name":"tpkn/queuem","owner":"tpkn","description":"The simpliest queue for Node.js you've ever seen","archived":false,"fork":false,"pushed_at":"2020-07-19T16:58:07.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-21T23:32:05.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/tpkn.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-16T22:03:12.000Z","updated_at":"2020-07-19T16:58:09.000Z","dependencies_parsed_at":"2023-02-27T06:15:38.192Z","dependency_job_id":null,"html_url":"https://github.com/tpkn/queuem","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"684a3d57f9bd8532ffc9f8d73fa70230861d8b97"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tpkn/queuem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fqueuem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fqueuem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fqueuem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fqueuem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpkn","download_url":"https://codeload.github.com/tpkn/queuem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpkn%2Fqueuem/sbom","scorecard":{"id":896113,"data":{"date":"2025-08-11","repo":{"name":"github.com/tpkn/queuem","commit":"684a3d57f9bd8532ffc9f8d73fa70230861d8b97"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T13:46:56.199Z","repository_id":74204176,"created_at":"2025-08-24T13:46:56.199Z","updated_at":"2025-08-24T13:46:56.199Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33633468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-14T14:29:06.649Z","updated_at":"2026-05-29T01:32:35.620Z","avatar_url":"https://github.com/tpkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Queuem [![npm Package](https://img.shields.io/npm/v/queuem.svg)](https://www.npmjs.org/package/queuem)\nThe simpliest queue for Node.js you've ever seen\n\n\nIt is made for cases when you need to run 1,000,000 tasks (parsing files, API requests, etc.) in a queue.\n\nWas originally made for [Page Check](https://www.npmjs.com/package/page-check) module.\n\n### Keep in mind:\n * No need for local storage or database.\n * The queue exists within the current Node.js process. \n * Based on Node.js `EventEmitter` and has a few [subtleties of use](https://nodejs.org/api/events.html#events_eventemitter_defaultmaxlisteners).\n\n\n\n## API\n```javascript\nlet Queue = new Queuem([options])\n```\n\n\n## Properties\n\n\n### parallel\n**Type**: _Number_  \n**Default**: `1`   \nGet/set the number of concurrent tasks. Takes effect immediately only when the number increases\n\n\n### emptyDelay\n**Type**: _Number_  \nAfter the queue is empty, the 'empty' event will be called immediately. This option allows to call the 'empty' event with a certain delay\n\n\n### queue   \n**Type**: _Array_  \nTasks list. Decreases as the tasks are completed\n\n\n### processing   \n**Type**: _Number_  \nAmount of currently running tasks   \n\n\n\n## Methods\n\n### append(task[, data])\n**Type**: _Function_    \nAdds a new task to the end of the queue\n\n\n### prepend(task[, data])\n**Type**: _Function_    \nAdds a new task to the beginning of the queue\n\n\n### pause()\n**Type**: _Function_    \nPauses processing the queue. But you can still add tasks in the queue\n\n\n### resume()\n**Type**: _Function_    \n\n\n### flush()\n**Type**: _Function_    \nClears the queue. Already running tasks would not be killed. `empty` event would be called immediately if there are no processing tasks\n\n\n\n\n## Task\n\nTask function should have three arguments\n\n\n### next\n**Type**: _Function_    \nWhen you feel like task is done, call `next()` function to pass the slot to the next task in a queue\n\n```javascript\nQueue.append((next, data) =\u003e {\n   // data =\u003e { job_id: 549 }\n   \n   // Tell the task manager that it can take the next task\n   next();\n\n}, { job_id: 549 })\n```\n\n\n\n### data\n**Type**: _Any_    \nSome data that needs to be passed into the task\n\n```javascript\nQueue.prepend(fn, { job_id: 549 })\n```\n\n\n\n### task\n**Type**: _Function_    \nTask function, just in case you want to run the task one more time\n\n\n\n\n\n\n## Events\n\n### added\nUseless event, but let it be\n\n\n\n\n### done\nTriggered each time a task is completed. If you passed something to the `next()` function, it will be available throught handler function argument\n\n```javascript\nQueue.on('done', (result) =\u003e {\n   // result =\u003e { job_id: 549 }\n})\n```\n\n\n### changed\nTriggered by any changes\n\n```javascript\nQueue.on('changed', (e) =\u003e {\n   // e.action =\u003e 'added' or 'done'\n})\n```\n\n\n### empty\nFires when queue is empty and there are no running tasks   \n\n\n\n\n\n## Usage   \n```javascript\nconst Queuem = require('queuem');\n\nlet Queue = new Queuem({ parallel: 2, emptyDelay: 5000 });\n\nQueue.on('done', (result) =\u003e {\n   console.log('done:',  result);\n})\n\nQueue.on('empty', () =\u003e {\n   console.log('--- COMPLETED ---');\n})\n\n\n\nfor(var i = 0; i \u003c 300; i++){\n   Queue.append(Task, { job_id: i })\n}\n\nfunction Task(next, data, task){\n   if(data.error){\n      // Append failed task back to the queue\n      data.retries = data.retries + 1 || 1;\n\n      if(data.retries \u003c 10){\n         Queue.append(task, data);\n      }\n   }\n\n   setTimeout(next, Math.random() * 2000, data)\n}\n\n// Let's increase the number of parallel tasks\nsetTimeout(() =\u003e Queue.parallel = 50, 3000);\n```\n\n\n\n\n## Changelog \n#### v3.2.0 (2019-10-06):\n- Added `task` argument\n\n#### v3.1.1 (2019-10-01):\n- Added `emptyDelay` option\n\n#### v3.1.0 (2019-09-29):\n- `data` and `next` arguments have been reversed\n\n#### v3.0.0 (2019-09-22):\n- Completely rethought the concept of the module\n\n#### v1.1.1 (2018-02-18):\n- Changed API, now constructor has only one argument\n- Added callback function for each finished task\n- Added `con` setter to changes the amount of concurrent tasks 'on the fly'\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fqueuem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpkn%2Fqueuem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpkn%2Fqueuem/lists"}