Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

off-sqs-debearloper

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

off-sqs-debearloper - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

68

lib/listQueues.js
var AWS = require('aws-sdk'),
config = require('./config'),
sqs = {},
when = require('when');
module.exports = listQueues = function (queueName){

@@ -10,3 +10,6 @@ var deferred = when.defer();

if(config.env.production || config.env.qa){
return listSQSQueues(queueName); };
AWS.config.update(config.awsConfigFile);
sqs = new AWS.SQS();
return listSQSQueues(queueName);
};

@@ -18,4 +21,2 @@ return listRabbitQueues(queueName);

var deferred = when.defer();
AWS.config.update(config.awsConfigFile);
var sqs = new AWS.SQS();

@@ -54,1 +55,60 @@ sqs.listQueues(function(err, res){

}
function listQueues(_queueName){
var deferred = when.defer();
sqs.listQueues(function(err, res){
var queueFinder = false;
if(res.QueueUrls)
for(var i in res.QueueUrls)
if(res.QueueUrls[i].split('/').pop() === _queueName)
queueFinder = true;
if(queueFinder){
getQueue(_queueName).then(function(queueUrl){
deferred.resolve(queueUrl);
});
} else {
createQueue(_queueName).then(function(){
getQueue(_queueName).then(function(queueUrl){
deferred.resolve(queueUrl);
})
});
};
});
return deferred.promise;
};
function getQueue(_queueName){
var deferred = when.defer();
sqs.getQueueUrl({QueueName: _queueName}, function(err, data){
if(err){
console.log("/63, " + err);
} else{
console.log("By using the SQS queue: " + data.QueueUrl);
deferred.resolve(data.QueueUrl);
}
});
return deferred.promise;
};
function createQueue(_queueName){
var deferred = when.defer();
var cqParams = {
QueueName: _queueName,
Attributes: {}
};
console.log(typeof sqs);
sqs.createQueue(cqParams, function(err, res){
if(err){
console.log("/67, " + err);
// stop recursivity
} else {
deferred.resolve();
}
});
return deferred.promise;
};

2

package.json
{
"name": "off-sqs-debearloper",
"description": "Helper app that manages SQS and RabbitMQ transactions",
"version": "0.1.7",
"version": "0.1.8",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

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