From a46048594ddb1fc071f355757abfc0d273d6a57d Mon Sep 17 00:00:00 2001 From: Nik Rahmel Date: Tue, 31 Oct 2017 11:18:58 +0000 Subject: [PATCH] Task: Update README * pass options through to SQS constructor --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a3ddce9..105b3a0 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,20 @@ npm install sqs-producer --save ```js var Producer = require('sqs-producer'); +// create simple consumer var producer = Producer.create({ queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name', region: 'eu-west-1' }); +// create custom producer (supporting all opts as per the API docs: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#constructor-property) +var producer = Producer.create({ + queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name', + region: 'eu-west-1' + accessKeyId: 'yourAccessKey', + secretAccessKey: 'yourSecret' +}); + // send messages to the queue producer.send(['msg1', 'msg2'], function(err) { if (err) console.log(err);