{"id":45984,"library":"queue-processor","title":"Queue Processor","description":"A lightweight Node.js library for consuming AWS SQS messages. It processes messages by passing them to a user-defined handler function and deletes them upon successful completion. The library also supports a deleteOnError option to preserve messages on failure and an optional logger. Version 1.2.1 is current; it has a stable API but limited updates. Key differentiators: minimal abstraction, direct SQS integration, and a simple callback-based interface.","status":"active","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/liamoehlman/queue-processor","tags":["javascript","sqs","queue","consumer","aws","processor"],"install":[{"cmd":"npm install queue-processor","lang":"bash","label":"npm"},{"cmd":"yarn add queue-processor","lang":"bash","label":"yarn"},{"cmd":"pnpm add queue-processor","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for SQS client and message operations","package":"aws-sdk","optional":false}],"imports":[{"note":"Only CommonJS require is supported; no ES module or named exports.","wrong":"import queueProcessor from 'queue-processor';","symbol":"queueProcessor","correct":"const queueProcessor = require('queue-processor');"},{"note":"Not a named export; it's a single default-like export via module.exports.","wrong":"const { queueProcessor } = require('queue-processor');","symbol":"queueProcessor","correct":"const queueProcessor = require('queue-processor');"},{"note":"Bare import does not work; use CommonJS require.","wrong":"import * as queueProcessor from 'queue-processor';","symbol":"queueProcessor","correct":"const queueProcessor = require('queue-processor');"}],"quickstart":{"code":"const queueProcessor = require('queue-processor');\n\nconst config = {\n  accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '',\n  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '',\n  region: 'us-east-1',\n  queueUrl: 'https://sqs.us-east-1.amazonaws.com/123456789012/my-queue',\n  deleteOnError: false\n};\n\nfunction handler(message, callback) {\n  console.log('Processing message:', message.Body);\n  // Process message...\n  callback(null); // Delete message on success\n}\n\nqueueProcessor(config, handler);","lang":"javascript","description":"Shows how to require the module, configure AWS credentials and SQS queue URL, define a message handler, and start processing messages."},"warnings":[{"fix":"Ensure all required config fields are provided, including accessKeyId, secretAccessKey, region, and queueUrl.","message":"The config object requires both accessKeyId and secretAccessKey; omitting them causes an AWS SDK error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set deleteOnError: true in config if you want to delete messages even on processing errors.","message":"The callback pattern: if you pass an error to the callback, the message is preserved (not deleted) by default. Only if deleteOnError is truthy will the message be deleted on error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use alternative libraries like sqs-consumer if you need batch processing or more advanced features.","message":"The library does not support Batch receive or delete operations; it processes one message at a time with default AWS SDK polling.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.1':48 'abstract':62 'also':33 'api':55 'aw':9,77 'base':71 'callback':70 'callback-bas':69 'complet':30 'consum':8,76 'current':50 'defin':22 'delet':26 'deleteonerror':36 'differenti':60 'direct':63 'failur':42 'function':24 'handler':23 'integr':65 'interfac':72 'javascript':73 'key':59 'librari':6,32 'lightweight':4 'limit':57 'logger':46 'messag':11,14,40 'minim':61 'node.js':5 'option':37,45 'pass':16 'preserv':39 'process':13 'processor':2,78 'queue':1,75 'simpl':68 'sqs':10,64,74 'stabl':54 'success':29 'support':34 'updat':58 'upon':28 'user':21 'user-defin':20 'version':47","created_at":"2026-06-07T12:57:42.531742+00:00","updated_at":"2026-06-07T12:57:42.531742+00:00","problems":[{"fix":"Replace 'import queueProcessor from \"queue-processor\"' with 'const queueProcessor = require(\"queue-processor\")'.","cause":"Using ES module import syntax which is not supported by this CommonJS package.","error":"TypeError: queueProcessor is not a function"},{"fix":"Ensure config.queueUrl is set correctly and matches the SQS queue URL.","cause":"The queueUrl config field is missing or misspelled.","error":"MissingRequiredParameter: Missing required key 'QueueUrl' in params"},{"fix":"Check that accessKeyId, secretAccessKey, and region are correctly set in the config object.","cause":"AWS SDK not initialized properly due to missing credentials or region.","error":"UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'deleteMessage' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/liamoehlman/queue-processor#readme","github":"https://github.com/liamoehlman/queue-processor","docs":null,"changelog":null,"pypi":null,"npm":"queue-processor","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}