{"id":21611347,"url":"https://github.com/singhs020/power-sqs","last_synced_at":"2025-04-11T05:34:08.034Z","repository":{"id":38008115,"uuid":"190518393","full_name":"singhs020/power-sqs","owner":"singhs020","description":"Powerful functions to deal with AWS SQS","archived":false,"fork":false,"pushed_at":"2024-05-19T04:17:08.000Z","size":2398,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-19T14:39:41.948Z","etag":null,"topics":["aws","backup-sqs","sqs"],"latest_commit_sha":null,"homepage":"https://singhs020.github.io/power-sqs/","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/singhs020.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-06T05:16:39.000Z","updated_at":"2024-05-22T01:25:40.071Z","dependencies_parsed_at":"2024-05-22T01:25:33.859Z","dependency_job_id":null,"html_url":"https://github.com/singhs020/power-sqs","commit_stats":{"total_commits":760,"total_committers":9,"mean_commits":84.44444444444444,"dds":0.3302631578947368,"last_synced_commit":"da67677d6bfea0e7a5a229c10b2bd942fba9c5f7"},"previous_names":[],"tags_count":114,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fpower-sqs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fpower-sqs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fpower-sqs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/singhs020%2Fpower-sqs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/singhs020","download_url":"https://codeload.github.com/singhs020/power-sqs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248347983,"owners_count":21088781,"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":["aws","backup-sqs","sqs"],"created_at":"2024-11-24T21:12:02.988Z","updated_at":"2025-04-11T05:34:08.010Z","avatar_url":"https://github.com/singhs020.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Travis badge](https://travis-ci.org/singhs020/power-sqs.svg?branch=master)\n[![Known Vulnerabilities](https://snyk.io/test/github/singhs020/power-sqs/badge.svg)](https://snyk.io/test/github/singhs020/power-sqs)\n\n[![NPM](https://nodei.co/npm/power-sqs.png?downloads=true)](https://www.npmjs.com/package/power-sqs/)\n\n## power-sqs\n\nPower-SQS is a set of powerful functions to deal with AWS SQS. It includes stream to read messages, move messages from one SQS to another or to a persistent data store.\n\nIf you just want to use sink operations, there is an option availble to use them via cli. Please see [power-sqs-cli](https://www.npmjs.com/package/power-sqs-cli)\n\n## How to install\n\n```javascript\nnpm install power-sqs\n```\n\n```javascript\nyarn add power-sqs\n```\n\n## How To Use\n\nPower SQS provides following functions to deal with AWS SQS\n\n## Reader\n\n### getSQSReader\nReturns a readable stream of messages with long polling of 10 seconds. The object mode is enabled in the stream and pushes single message across the pipe.\n\n```javascript\nconst {getSQSReader} = require(\"power-sqs\");\n\nconst config = {\"url\": \"your sqs url\"};\nconst sqsReader = getSQSReader(config);\n\n// returns a Node.js readable stream.\n\nsqsReader.pipe(\"stream of your choice.\")\n\n```\n\n### getSQSPowerReader\nReturns a highland stream. The stream can then be used to apply transformers like filter, map, find and etc to generate a stream of data before piping it to another stream.\n\nPlease see [highland transformers](https://highlandjs.org/#Transforms) for more information.\n\n```javascript\nconst {getSQSPowerReader} = require(\"power-sqs\");\n\nconst config = {\"url\": \"your sqs url\"};\nconst sqsReader = getSQSPowerReader(config);\n\n// returns a Node.js readable stream.\n\nsqsReader.filter(() =\u003e {\n  // filter logic\n}).pipe(\"stream of your choice\");\n\n```\n\n### getSQSBulkReader\nReturns a readable stream of messages with long polling of 10 seconds. The object mode is enabled in the stream and returns the complete data object returned from the AWS.\n\nThe messgages in the pushed chunk can be accessed via the the Messages. It only pushes the data if it has any number of Messages attached to it otherwise it will keep on polling the SQS.\n\n```javascript\nconst {getSQSBulkReader} = require(\"power-sqs\");\n\nconst config = {\"url\": \"your sqs url\"};\nconst sqsReader = getSQSBulkReader(config);\n\n// returns a Node.js readable stream.\n\nsqsReader.pipe(\"stream of your choice.\")\n\n```\n\n## DeleteMessages\nAllows you to delete the messages in batch\n\n```javascript\nconst {deleteMessages} = require(\"power-sqs\");\n\nconst queueUrl = \"your sqs url\";\nconst messages = [{}] // array of messages you want to delete\n\nreturn deleteMessages(queueUrl, messages)\n.then(res =\u003e console.log(res));\n```\n\n## SendMessages\nAllows you to send the messages in batch\n\n```javascript\nconst {sendMessages} = require(\"power-sqs\");\n\nconst queueUrl = \"your sqs url\";\nconst messages = [{\"foo\": \"bar\"}] // data you want to send as messages\n\nreturn sendMessages(queueUrl, messages)\n.then(res =\u003e console.log(res));\n```\n\n## SendFifoMessages\nAllows you to send the messages in batch\n\n```javascript\nconst {sendFifoMessages} = require(\"power-sqs\");\n\nconst queueUrl = \"your sqs url\";\nconst group = \"groupid\";\nconst messages = [{\"foo\": \"bar\"}] // data you want to send as messages\n\nreturn sendFifoMessages(queueUrl, group, messages)\n.then(res =\u003e console.log(res));\n```\n\n## receiveMessages\nAllows you to receive the messages from a sqs. If you are looking for something to poll continuously, have a look at other reader functions which provide streaming and filtering options too.\n\n```javascript\nconst {sendMessages} = require(\"power-sqs\");\n\nconst queueUrl = \"your sqs url\";\n\nreturn receiveMessages(queueUrl)\n.then(res =\u003e console.log(res));\n```\n\n\n## Sink\n\n### initSinkToSQS\nAllows you to move messages from one SQS to another in same AWS Account.\n\n```javascript\nconst {initSinkToSQS} = require(\"power-sqs\");\n\nconst source = {\"url\": \"your sqs url\"};\nconst destination = {\"url\": \"your sqs url\"};\nconst config = {source, destination};\n\ninitSinkToSQS(config);\n\n```\n\n## Examples\nsome of the examples related to specifically single operations like sendMessages, deleteMessages etc are provided in [examples](./examples) directory.\n\n### Support or Contact\n\nHaving trouble with power-sqs or have any questions? Please raise an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinghs020%2Fpower-sqs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinghs020%2Fpower-sqs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinghs020%2Fpower-sqs/lists"}