{"id":31823620,"url":"https://github.com/digitalmaas/sqsumer","last_synced_at":"2026-04-17T05:02:35.973Z","repository":{"id":57368434,"uuid":"121457210","full_name":"digitalmaas/sqsumer","owner":"digitalmaas","description":"Worker to consume AWS SQS messages. Built with Serverless and AWS Lambda in mind.","archived":false,"fork":false,"pushed_at":"2018-02-19T03:25:41.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-08T18:38:19.552Z","etag":null,"topics":["async-await","aws","aws-lambda","aws-sqs","bluebird","consumer","digitalmaas","javascript","lambda","lawos","node-js","nodejs","promises","queue","serverless","serverless-framework","sqs","sqs-queue","worker"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalmaas.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-02-14T01:23:09.000Z","updated_at":"2023-03-04T00:54:47.000Z","dependencies_parsed_at":"2022-09-05T20:51:30.021Z","dependency_job_id":null,"html_url":"https://github.com/digitalmaas/sqsumer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/digitalmaas/sqsumer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalmaas%2Fsqsumer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalmaas%2Fsqsumer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalmaas%2Fsqsumer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalmaas%2Fsqsumer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalmaas","download_url":"https://codeload.github.com/digitalmaas/sqsumer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalmaas%2Fsqsumer/sbom","scorecard":{"id":342554,"data":{"date":"2025-08-11","repo":{"name":"github.com/digitalmaas/sqsumer","commit":"e4d60eb4b0d278086dbe4960d33effd5a1dd4eeb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/4 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":"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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-18T06:14:06.807Z","repository_id":57368434,"created_at":"2025-08-18T06:14:06.807Z","updated_at":"2025-08-18T06:14:06.807Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007475,"owners_count":26084313,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"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":["async-await","aws","aws-lambda","aws-sqs","bluebird","consumer","digitalmaas","javascript","lambda","lawos","node-js","nodejs","promises","queue","serverless","serverless-framework","sqs","sqs-queue","worker"],"created_at":"2025-10-11T14:54:50.426Z","updated_at":"2025-10-11T14:54:52.469Z","avatar_url":"https://github.com/digitalmaas.png","language":"JavaScript","readme":"Sqsumer - AWS SQS worker\n========================\n\n[![NPM version][version-badge]][npm-url]\n[![digitalmaas][dmaas-badge]][dmaas-url]\n[![NPM downloads][downloads-badge]][npm-url]\n[![standardjs][standardjs-badge]][standardjs-url]\n\nLibrary to process messages from an Amazon SQS queue with an AWS Lambda worker function or your favorite other JavaScript environment. Based of _Sebastian Müller_'s work on [lawos][lawos].\n\n## Install\n\nSqsumer depends on [AWS SDK for JavaScript in Node.js][aws-sdk] and [bluebird][bluebird].\n\n```bash\n$ \u003e npm install bluebird aws-sdk sqsumer --save\n```\n\n## API\n\n### 🔷 constructor\n\n#### Syntax\n\u003e `new Sqsumer(queueUrl, sqs[, `_`messagesPerIteration`_`])`\n\n#### Parameters\n\n1. **queueUrl**\n    - Address of the target SQS queue\n1. **sqs**\n    - Instance of SQS client from AWS SDK\n1. **messagesPerIteration**\n    - Maximum number of messages received per iteration (`[1, 10]`, default `10`)\n\n#### Return Value\nAn Sqsumer instance.\n\n     \n\n### 🔷 item\n\n#### Syntax\n\u003e `instance.item(workerCallback)`\n\n#### Parameters\n\n1. **workerCallback**\n    - Function that processes each received message.\n        + **Parameters**\n            1. _message_\n                * A message from the target queue.\n        + **Returns**\n            * If it is a common function, it will be wrapped in a promise, where a return value will resolve it and a throw will rejected it. It can also return a promise, which will work as expected. If the promise is resolved, the message will be removed from the queue; otherwise, no action will be taken.\n\n#### Return Value\nA reference to of its instance, so calls can be chained.\n\n     \n\n### 🔷 work\n\n#### Syntax\n\u003e `instance.work(stopConditionCallback)`\n\n#### Parameters\n\n1. **stopConditionCallback**\n    - Function that is invoked in the end of each iteration.\n        + **Parameters**\n            1. _metrics_\n                * Latest metrics from the current worker session.\n        + **Returns**\n            * If it is a common function, it will be wrapped in a promise, where a return value will resolve it and a throw will rejected it. It can also return a promise, which will work as expected. If the promise is resolved, the return value will be evaluated: if truthy, worker session ends; if falsy, worker session continues. If the promise is rejected, the worker session ends.\n\n#### Return Value\nA promise, which will be resolved with the worker session metrics.\n\n## Example\n\nAssuming you're using AWS Lambda:\n\n```javascript\nconst SQS = require('aws-sdk/clients/sqs') // who needs it all?\nconst sqs = new SQS()\n\nconst Sqsumer = require('sqsumer')\nconst actualWork = require('./actualWork')\n\nmodule.exports.handler = (event, context, done) =\u003e {\n  new Sqsumer('https://sqs.eu-west-1.amazonaws.com …', sqs)\n    .item(message =\u003e actualWork(message))\n    .work(() =\u003e context.getRemainingTimeInMillis() \u003c 1000)\n    .then(metrics =\u003e {\n      done(null, metrics)\n    })\n}\n```\n\n## License\n\nMIT License.    \nFor the complete information, please refer to the [license](./LICENSE) file.\n\n\n[dmaas-badge]: https://img.shields.io/badge/sponsored%20by-digitalmaas-green.svg?colorB=00CD98\u0026style=flat-square\n[dmaas-url]: https://digitalmaas.com/\n[version-badge]: https://img.shields.io/npm/v/sqsumer.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dm/sqsumer.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/sqsumer\n[standardjs-badge]: https://img.shields.io/badge/code_style-standardjs-brightgreen.svg?style=flat-square\n[standardjs-url]: https://standardjs.com/\n[lawos]: https://github.com/sbstjn/lawos\n[aws-sdk]: https://aws.amazon.com/sdk-for-node-js/\n[bluebird]: http://bluebirdjs.com","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalmaas%2Fsqsumer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalmaas%2Fsqsumer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalmaas%2Fsqsumer/lists"}