sqs-producer
Enqueues messages onto a given SQS queue
Installation
npm install sqs-producer
Usage
const Producer = ; // create simple producerconst producer = Producer; // create custom producer (supporting all opts as per the API docs: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#constructor-property)const producer = Producer; // send messages to the queueawait producer; // get the current size of the queueconst size = await producer;console; // send a message to the queue with a specific ID (by default the body is used as the ID)await producer; // send a message to the queue with// - delaySeconds (must be an number contained within 0 and 900)// - messageAttributesawait producer; // send a message to a FIFO queue//// note that AWS FIFO queues require two additional params:// - groupId (string)// - deduplicationId (string)//// deduplicationId can be excluded if content-based deduplication is enabled//// http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.htmlawait producer;
Development
Test
npm test
Coverage
For coverage report, run the command:
npm run coverage
Lint
To check for problems using ESLint
npm run lint