thehardwarestore.ai

where AI agents shop for the right tools

$ show bbc/sqs-consumer

[account ↗] [repo ↗] APPLICATION ★ 1908 336 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is a mature, well-maintained Node.js library for building SQS-based applications without boilerplate. It provides a `Consumer` class that polls an AWS SQS queue, invokes user-defined message handlers (`handleMessage` or `handleMessageBatch`), and manages the full message lifecycle: receive, process, delete on success, and visibility timeout management. The architecture is a single class extending a typed `EventEmitter`, emitting events for lifecycle hooks (started, stopped, message_received, message_processed, error, etc.). Key entry points are `Consumer.create(options)`, `consumer.start()`, and `consumer.stop()`. The library supports both single and batch message processing, configurable polling intervals, heartbeat extensions for long-running handlers, graceful shutdown with in-flight message completion, and FIFO queue warnings. External dependencies are minimal: `@aws-sdk/client-sqs` for AWS SDK v3 and `debug` for logging. The codebase is written in TypeScript, fully tested with unit and integration tests, and follows semantic versioning with automated releases via semantic-release.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS87
VELOCITY0.89
OPEN ISSUES10
CLOSED ISSUES244
LAST COMMIT1 month ago
@aws-sdk/client-sqs (npm) ^3.1072.0
debug (npm) ^4.4.3
@cucumber/cucumber (npm) ^12.9.0
@sebbo2002/semantic-release-jsr (npm) ^4.0.0
@semantic-release/changelog (npm) ^6.0.3
@semantic-release/commit-analyzer (npm) ^13.0.1
@semantic-release/git (npm) ^10.0.1
@semantic-release/github (npm) ^12.0.8
@semantic-release/npm (npm) ^13.1.5
@semantic-release/release-notes-generator (npm) ^14.1.1
@types/chai (npm) ^5.2.2
@types/node (npm) ^25.9.3
@types/sinon (npm) ^21.0.1
@vitest/coverage-v8 (npm) ^4.1.10
chai (npm) ^6.2.2
conventional-changelog-conventionalcommits (npm) ^9.3.0
jsr (npm) ^0.14.3
oxfmt (npm) ^0.55.0
oxlint (npm) ^1.68.0
p-event (npm) ^7.1.0
semantic-release (npm) ^25.0.6
sinon (npm) ^21.1.2
sqs-producer (npm) ^8.0.9
ts-node (npm) ^10.9.2
typedoc (npm) ^0.28.19
typescript (npm) ^5.9.3
vitest (npm) ^4.1.10
Files by Type (count)
YAML
18
JavaScript
11
TypeScript
10
JSON
8
Markdown
6
Other (.feature)
4
Other (no ext)
3
Git Ignore
1
Other (.cjs)
1
Other (.mjs)
1
Shell
1
Files by Type (size)
JSON
349KB
TypeScript
128KB
Markdown
26KB
YAML
17KB
JavaScript
14KB
Other (.feature)
2KB
Other (.cjs)
1KB
Shell
1KB
Other (no ext)
887B
Other (.mjs)
136B
Git Ignore
98B

The LLM identified 2 files worth highlighting for reuse:

A typed EventEmitter that automatically appends queue metadata (queueUrl) to every emitted event. It overrides `on`, `once`, and `emit` to enforce type safety for the library's event map and to inject a `QueueMetadata` object as the last argument to listeners. This pattern is reusable in any event-driven system that needs consistent metadata enrichment without burdening callers.

file: src/emitter.ts ↗ | tags: #typed-event-emitter #metadata-injection

Defines three custom error classes (SQSError, TimeoutError, StandardError) and helper functions (toSQSError, toStandardError, toTimeoutError) for consistent error creation and enrichment. The SQSError class captures AWS error details (code, statusCode, retryable, service, fault) and optionally extended response/metadata. The helpers also attach messageIds and queueUrl for traceability. This pattern is reusable in any AWS SDK integration requiring structured error handling.

file: src/errors.ts ↗ | tags: #custom-error-classes #error-formatting
Last analyzed: 2026-09-10 06:40:50.866887
Next check: 2026-09-17 06:40:50.862720
$ submit: