A Node.js library for enqueuing messages to Amazon SQS queues. It provides a simple Producer class for creating producers with configuration for region, queue URL, and AWS credentials. Supports sending individual or batched messages, custom message IDs, delay seconds, message attributes, and FIFO queue parameters (groupId, deduplicationId). Includes queue size retrieval. Version 2.1.2 is the latest stable release. Ships TypeScript definitions. Designed for use with the AWS SDK v2 or v3 (v3 recommended). Key differentiators: simple API, direct use of AWS SDK config, and support for FIFO queues.
npm install sqs-producer-2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an SQS producer, retrieves queue size, and sends two messages with different options.
Use the `sqs` option with an AWS SDK v3 SQSClient instance.
Install aws-sdk (v2) or @aws-sdk/client-sqs (v3) as a dependency.
Consider migrating to AWS SDK v3 and use the `sqs` option.
Always include `groupId` and `deduplicationId` (if content-based dedup disabled) in the message object.
Ensure `delaySeconds` is within 0-900 and note that AWS limits per-message delay when batching.
Install aws-sdk: npm install aws-sdk
Use `import { Producer } from 'sqs-producer'` or `const { Producer } = require('sqs-producer')`Provide queueUrl option when creating producer.
Set region and accessKeyId/secretAccessKey in producer config or environment variables.