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

cfn-stack-event-stream

Package Overview
Dependencies
Maintainers
44
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cfn-stack-event-stream - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

test/index.test.js

19

index.js

@@ -7,3 +7,2 @@ var Readable = require('stream').Readable;

var stream = new Readable({objectMode: true}),
since = options.since || new Date(),
pollInterval = options.pollInterval || 1000,

@@ -16,2 +15,6 @@ describing = false,

if (options.lastEventId) {
seen[options.lastEventId] = true;
}
stream._read = function() {

@@ -33,5 +36,5 @@ if (describing || complete) return;

// Assuming StackEvents are in strictly reverse chronological order.
// If we get to what we've seen already, or to old events, we don't
// need to go on to the next page.
if (event.Timestamp < since || seen[event.EventId])
// If we get to what we've seen already we don't need to go on to the
// next page.
if (seen[event.EventId])
break;

@@ -55,2 +58,6 @@

}
}).on('retry', function(res) {
// Force a minimum 5s retry delay.
res.error.retryDelay = Math.max(5000, res.error.retryDelay||5000);
stream.emit('retry', res.error);
});

@@ -72,2 +79,6 @@ }

}
}).on('retry', function(res) {
// Force a minimum 5s retry delay.
res.error.retryDelay = Math.max(5000, res.error.retryDelay||5000);
stream.emit('retry', res.error);
});

@@ -74,0 +85,0 @@ }

{
"name": "cfn-stack-event-stream",
"version": "0.0.2",
"version": "0.0.3",
"description": "A readable stream of CloudFormation stack events",
"main": "index.js",
"scripts": {
"test": "tap test.js"
"test": "tape test/*.test.js"
},

@@ -12,7 +12,7 @@ "author": "John Firebaugh <john@mapbox.com>",

"dependencies": {
"aws-sdk": "^2.0.0-rc13"
"aws-sdk": "^2.2.0"
},
"devDependencies": {
"tap": "^0.4.8"
"tape": "~4.4.0"
}
}

@@ -28,1 +28,19 @@ A readable stream of CloudFormation stack events.

```
## API
### `EventStream(cfn, stackName, options)`
Returns an object-mode [readable stream](http://nodejs.org/api/stream.html#stream_class_stream_readable)
which emits `StackEvent` objects as returned by [`describeStackEvents`](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html#describeStackEvents-property)
Required parameters:
* `cfn`: An [`AWS::CloudFormation`](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html) instance.
* `stackName`: The name or ARN of the stack. Note that if you are reading events for a stack that is deleted or in the
process of being deleted, you need to pass the full ARN rather than the stackName.
Options:
* `lastEventId`: The `EventId` of a `StackEvent`. StackEvents emitted by the resulting stream
are guaranteed not to include this event or any preceding events.
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