aws-sqs-poll
Advanced tools
Comparing version 0.0.1 to 0.0.2
'use strict'; | ||
const AWS = require('aws-sdk'); | ||
const pify = require('pify'); | ||
const isAWSID = require('is-aws-account-id'); | ||
const isAwsAccountId = require('is-aws-account-id'); | ||
@@ -29,3 +29,3 @@ const sqs = new AWS.SQS(); | ||
} | ||
if (opts.awsAccountId && !isAWSID(opts.awsAccountId)) { | ||
if (opts.awsAccountId && !isAwsAccountId(opts.awsAccountId)) { | ||
return Promise.reject(new TypeError('Invalid AWS Account Id')); | ||
@@ -32,0 +32,0 @@ } |
{ | ||
"name": "aws-sqs-poll", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Polling messages from AWS SQS", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -24,4 +24,14 @@ # aws-sqs-poll [![Build Status](https://travis-ci.org/SimonJang/aws-sqs-poll.svg?branch=master)](https://travis-ci.org/SimonJang/aws-sqs-poll) | ||
awsSqsPoll('QueueName', [options]) | ||
// [messages] | ||
awsSqsPoll('QueueName') | ||
// ["MessageId": "28f61fd2-b9ca-4cb9-879a-71ea8bce4636", | ||
// "ReceiptHandle": "AQEB9mnsxtAZlwnDERxn3yADAP96QRe0KPbqaKXLvvchqmD4jAr", | ||
// "MD5OfBody": "098f6bcd4621d373cade4e832627b4f6", | ||
// "Body": "test"] | ||
awsSqsPoll('QueueName', {AwsAccountId: '123456789012', numberOfMessages: 1, timeout: 20, json: false}) | ||
// ["MessageId": "28f61fd2-b9ca-4cb9-879a-71ea8bce4636", | ||
// "ReceiptHandle": "AQEB9mnsxtAZlwnDERxn3yADAP96QRe0KPbqaKXLvvchqmD4jAr", | ||
// "MD5OfBody": "098f6bcd4621d373cade4e832627b4f6", | ||
// "Body": "test"] | ||
``` | ||
@@ -31,3 +41,3 @@ | ||
### aws-sqs-poll(queueName, options) | ||
### aws-sqs-poll(queueName, [options]) | ||
@@ -43,3 +53,3 @@ #### queueName | ||
`options.awsAccountId` | ||
##### options.awsAccountId | ||
@@ -51,17 +61,17 @@ Type: `string` | ||
`options.numberOfMessages` | ||
##### options.numberOfMessages | ||
Type: `number` | ||
Number of messages to be retrieved in 1 polling action. | ||
Number of messages to be retrieved in 1 polling action. When polling a queue with few messages (< 1000 messages), you will get less messages then the numberOfMessages parameter. | ||
`options.timeout` | ||
##### options.timeout | ||
Type: `number` | ||
Timeout to listen to the queue for new messages. | ||
Timeout (polling time) to listen to the queue for new messages. | ||
`options.json` | ||
##### options.json | ||
@@ -68,0 +78,0 @@ Type: `boolean` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5652
81