npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sqs-producer-lib

v3.0.5

Published

Reusable AWS SQS producer library for Node.js microservices

Readme

📨 AWS SQS Client (Class-based)

A reusable Node.js library using a class-based wrapper to send messages to AWS SQS queues.
Seamlessly supports both LocalStack for local testing and AWS SQS for production with dynamic queue URLs.


🚀 Features

  • ✅ Class-based, object-oriented design
  • 🌍 Works with both LocalStack and AWS
  • ⚙️ Customizable with constructor config
  • 🛡 Helpful console logs and robust error handling
  • 📦 Easy to plug into any Node.js project

📦 Installation

# Local path install
npm install /path/to/your/sqs-client-lib

# OR if published as npm package
npm install @your-org/sqs-client

🛠️ Usage

1. Import and create an instance of SQSClient

const SQSClient = require('./src/SQSClient');

const sqsClient = new SQSClient({
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  region: process.env.AWS_REGION || 'us-east-1',
  useLocalstack: process.env.USE_LOCALSTACK === 'true',
  localstackEndpoint: process.env.LOCALSTACK_ENDPOINT || 'http://localhost:4566',
  accountId: process.env.AWS_ACCOUNT_ID || '000000000000',
});

2. Send a message to the queue

const message = {
  orderId: '123456',
  action: 'order_placed',
};

sqsClient.sendMessage('your-queue-name', message)
  .then((res) => console.log('✅ Message ID:', res.MessageId))
  .catch((err) => console.error('❌ Error:', err.message));

⚙️ Config Options

You can pass these to the constructor:

| Option | Type | Description | Default | |----------------------|----------|------------------------------------------|-------------------------| | accessKeyId | string | AWS access key | Required | | secretAccessKey | string | AWS secret key | Required | | region | string | AWS region | us-east-1 | | useLocalstack | boolean | Enable LocalStack | false | | localstackEndpoint | string | LocalStack endpoint | http://localhost:4566 | | accountId | string | AWS account ID | 000000000000 |


📂 Project Structure Example

your-project/
├── src/
│   └── SQSClient.js         # This file
├── example.js               # How you use the client
├── .env                     # Store environment variables here
└── README.md                # You're here!

🧪 LocalStack Testing

Step-by-step:

  1. Run LocalStack via Docker
docker run --rm -it -p 4566:4566 localstack/localstack
  1. Create a queue via AWS CLI:
aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name your-queue-name
  1. Set .env values:
USE_LOCALSTACK=true
AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test
AWS_REGION=us-east-1
LOCALSTACK_ENDPOINT=http://localhost:4566
AWS_ACCOUNT_ID=000000000000

📜 License

MIT License
© 2025 Kenit Goswami


🙋‍♂️ Questions or Contributions?

Feel free to open issues or PRs. Feedback and improvements are always welcome!


🔗 Useful Links