Gathering detailed insights and metrics for sqs-producer
Gathering detailed insights and metrics for sqs-producer
Gathering detailed insights and metrics for sqs-producer
Gathering detailed insights and metrics for sqs-producer
@types/sqs-producer
Stub TypeScript definitions entry for sqs-producer, which provides its own types definitions
@houlak/hk-audit-producer
Client for pushing new messages in aws sqs
@devplace/sqs-producer
Devplace SQS producer lib
headless-sqs
Headless SQS package creates queues if do not exist with a sample configuration.
Simple scaffolding for applications that produce SQS messages
npm install sqs-producer
Typescript
Module System
Min. Node Version
Node Version
NPM Version
v7.0.0-canary.4
Updated on May 09, 2025
v7.0.0-canary.3
Updated on May 09, 2025
v7.0.0
Updated on May 09, 2025
v7.0.0-canary.2
Updated on Jan 08, 2025
v7.0.0-canary.1
Updated on Jan 08, 2025
v6.1.0-canary.1
Updated on Jan 08, 2025
TypeScript (94.78%)
JavaScript (5.22%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
217 Stars
235 Commits
52 Forks
32 Watchers
27 Branches
90 Contributors
Updated on Jun 28, 2025
Minified
Minified + Gzipped
Latest Version
6.0.1
Package Id
sqs-producer@6.0.1
Unpacked Size
58.93 kB
Size
18.59 kB
File Count
44
NPM Version
10.8.2
Node Version
20.17.0
Published on
Oct 01, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
26
Enqueues messages onto a given SQS queue.
To install this package, enter the following command into your terminal (or the variant of whatever package manager you are using):
npm install sqs-producer
We will only support Node versions that are actively or security supported by the Node team. If you are still using an Node 14, please use a version of this library before the v3.2.1 release, if you are using Node 16, please use a version before the v3.3.0 release.
Visit https://bbc.github.io/sqs-producer/ for the full API documentation.
1import { Producer } from 'sqs-producer'; 2import { SQSClient } from '@aws-sdk/client-sqs'; 3 4// create simple producer 5const producer = Producer.create({ 6 queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name', 7 region: 'eu-west-1' 8}); 9 10// send messages to the queue 11await producer.send(['msg1', 'msg2']); 12 13// get the current size of the queue 14const size = await producer.queueSize(); 15console.log(`There are ${size} messages on the queue.`); 16 17// send a message to the queue with a specific ID (by default the body is used as the ID) 18await producer.send([ 19 { 20 id: 'id1', 21 body: 'Hello world' 22 } 23]); 24 25// send a message to the queue with 26// - delaySeconds (must be an number contained within 0 and 900) 27// - messageAttributes 28await producer.send([ 29 { 30 id: 'id1', 31 body: 'Hello world with two string attributes: attr1 and attr2', 32 messageAttributes: { 33 attr1: { DataType: 'String', StringValue: 'stringValue' }, 34 attr2: { DataType: 'Binary', BinaryValue: new Buffer('binaryValue') } 35 } 36 }, 37 { 38 id: 'id2', 39 body: 'Hello world delayed by 5 seconds', 40 delaySeconds: 5 41 } 42]); 43 44// send a message to a FIFO queue 45// 46// note that AWS FIFO queues require two additional params: 47// - groupId (string) 48// - deduplicationId (string) 49// 50// deduplicationId can be excluded if content-based deduplication is enabled 51// 52// https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html 53await producer.send({ 54 id: 'testId', 55 body: 'Hello world from our FIFO queue!', 56 groupId: 'group1234', 57 deduplicationId: 'abcdef123456' // typically a hash of the message body 58});
By default the consumer will look for AWS credentials in the places specified by the AWS SDK. The simplest option is to export your credentials as environment variables:
1export AWS_SECRET_ACCESS_KEY=... 2export AWS_ACCESS_KEY_ID=...
If you need to specify your credentials manually, you can use a pre-configured instance of the SQS Client client.
1import { Producer } from 'sqs-producer'; 2import { SQSClient } from '@aws-sdk/client-sqs'; 3 4// create simple producer 5const producer = Producer.create({ 6 queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name', 7 region: 'eu-west-1', 8 sqs: new SQSClient({ 9 region: 'my-region', 10 credentials: { 11 accessKeyId: 'yourAccessKey', 12 secretAccessKey: 'yourSecret' 13 } 14 }) 15}); 16 17// send messages to the queue 18await producer.send(['msg1', 'msg2']);
1npm test
For coverage report, run the command:
1npm run coverage
To check for problems using ESLint
1npm run lint
We welcome and appreciate contributions for anyone who would like to take the time to fix a bug or implement a new feature.
But before you get started, please read the contributing guidelines and code of conduct.
SQS Producer is distributed under the Apache License, Version 2.0, see LICENSE for more information.
No vulnerabilities found.
Reason
no vulnerabilities detected
Reason
tokens are read-only in GitHub workflows
Reason
license file detected
Details
Reason
no dangerous workflow patterns detected
Reason
all dependencies are pinned
Details
Reason
no binaries found in the repo
Reason
update tool detected
Details
Reason
GitHub code reviews found for 11 commits out of the last 30 -- score normalized to 3
Details
Reason
0 commit(s) out of 30 and 0 issue activity out of 28 found in the last 90 days -- score normalized to 0
Reason
no badge detected
Reason
security policy file not detected
Reason
project is not fuzzed
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2022-08-15
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More