off-sqs

0.1.6 • Public • Published

OFF-SQS: Manage SQS on node.js

This easy manager provides the basic functionality to use Amazon SQS. To start using it just clone it or install it via npm npm install off-sqs and edit the aws-config.json:

{ 
	"accessKeyId": "STRING", 
	"secretAccessKey": "STRING", 
	"region": "STRING" 
}

NOTE that every operation checks first if the Queue exists, if not it'll create it.


Methods

Sender

Params: the name of the SQS queue and the data you want to send.
Returns: nothing.
Usage: sqs.sender('myQueue', ["foo": "bar"]);

Receiver

Params: the name of the SQS queue.
Return: a promise which it became a tuple of receivera function and queueUrl a string.
Usage:

sqs.receiver('myQueue').then(function(Receiver){
	Receiver.receiver(yourDataManager, Receiver.url);
}

Note: Where yourDataManager is a function that receives every message on the queue, so you can easy custom your data miner. Something like: `myMiner(messageOfTheQueue);``

getQueueUrl

Params: The name of the SQS Queue.
Returns: A promise which became the url of the Queue.
Usage:

sqs.getQueueUrl('myQueue').then(function('myQueueURL'){
	return myQueueURL;
});

parseMessage

Params: Data received by SQS Queues.
Returns: The cleaned data of the body as array.
Usage: sqs.parseMessage(data);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.6
    0
    • latest

Version History

Package Sidebar

Install

npm i off-sqs

Weekly Downloads

7

Version

0.1.6

License

GNU

Last publish

Collaborators

  • sospedra