Socket
Socket
Sign inDemoInstall

sqs-producer

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqs-producer - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

coverage.html

2

index.js

@@ -1,1 +0,1 @@

module.exports = require('./lib/producer.js');
module.exports = require('./lib/producer.js');
var AWS = require('aws-sdk');
var selectn = require('selectn');

@@ -59,4 +60,15 @@ var BATCH_SIZE = 10;

Producer.prototype.queueSize = function (cb) {
this.sqs.getQueueAttributes({
QueueUrl: this.queueUrl,
AttributeNames: ['ApproximateNumberOfMessages']
}, function (err, result) {
if (err) return cb(err);
cb(null, selectn('Attributes.ApproximateNumberOfMessages', result));
});
};
module.exports.create = function(options) {
return new Producer(options);
};
{
"name": "sqs-producer",
"version": "1.0.3",
"version": "1.1.0",
"description": "Enqueues messages onto a given SQS queue",

@@ -29,2 +29,3 @@ "main": "index.js",

"aws-sdk": "^2.1.2",
"selectn": "^0.9.6",
"sinon": "^1.12.2"

@@ -31,0 +32,0 @@ },

@@ -23,2 +23,3 @@ sqs-producer

// send messages to the queue
producer.send(['msg1', 'msg2'], function(err) {

@@ -28,2 +29,9 @@ if (err) console.log(err);

// get the current size of the queue
producer.queueSize(function (err, size) {
if (err) console.log(err);
console.log('There are', size, 'messages on the queue.');
});
```

@@ -30,0 +38,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc