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

alexa-ability-timeout

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alexa-ability-timeout - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

12

lib/createTimeoutMiddleware.js

@@ -51,13 +51,15 @@ 'use strict';

// be ready to cancel the timeout
var onSent = function onSent() {
function clearTimeoutWrapper() {
if (!req.timedOut) log('request finished on time');
clearTimeout(timeout);
};
req.on('finished', onSent);
req.on('failed', onSent);
}
log('setup timer');
req.on('finished', clearTimeoutWrapper);
req.on('failed', clearTimeoutWrapper);
req.timedOut = false;
req.clearTimeout = clearTimeoutWrapper;
log('timer setup');
next();
};
}
{
"name": "alexa-ability-timeout",
"version": "0.2.1",
"version": "0.2.2",
"description": "An alexa-ability middleware to prevent stalled requests.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -52,1 +52,7 @@ # alexa-ability-timeout [![Build Status](https://travis-ci.org/nickclaw/alexa-ability-timeout.svg?branch=master)](https://travis-ci.org/nickclaw/alexa-ability-timeout)

the given `ms` have passed.
##### `req.clearTimeout()`
A function to stop the timeout completely.
##### `req.timedOut`
A boolean indicating whether the request has timed out.
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