lawos - Lambda Worker SQS
Library to process messages from an Amazon SQS queue with an AWS Lambda worker function or your favorite other JavaScript environment. Works fine with Serverless …
Install
$ > npm install lawos
Example
See lawos-serverless for an example of Lawos using Serverless.
Usage
Promise for every message
const AWS = ;const SQS = apiVersion: '2012-11-05'; const Lawos = ;const Q = 'https://sqs.eu-west-1.amazonaws.com …' SQS; Q; moduleexports { Q;};
Promise for a batch of messages
const AWS = ;const SQS = apiVersion: '2012-11-05'; const Lawos = ;const Q = 'https://sqs.eu-west-1.amazonaws.com …' SQS; Q; moduleexports { Q;};
Use AWS Lambda instead of Promise
const AWS = ;const Lawos = ; const Lambda = apiVersion: '2015-03-31';const SQS = apiVersion: '2012-11-05'; const Q = 'https://sqs.eu-west-1.amazonaws.com …' SQS Lambda; Q;// Q.list('fake-function-name'); moduleexports { Q;};
License
Feel free to use the code, it's released using the MIT license.