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

callback-timeout

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callback-timeout - npm Package Compare versions

Comparing version 3.0.1 to 4.0.0

5

CHANGELOG.md
# callback-timeout changelog
## v4.0.0
* Added ability to pass `false` as 3rd argument to indicate callback should be
invoked after timing out with no error.
## v3.0.0

@@ -4,0 +9,0 @@

2

index.js

@@ -10,2 +10,4 @@ var errors = require('./errors')

timer = null
if (e === false)
return f.call(f, null)
var msg = e || 'timeout of ' +

@@ -12,0 +14,0 @@ t + 'ms exceeded for callback ' +

4

package.json
{
"name": "callback-timeout",
"version": "3.0.1",
"version": "4.0.0",
"description": "Invokes callback with single error argument if timeout occurs before it's invoked by other means",

@@ -21,6 +21,6 @@ "main": "index.js",

"devDependencies": {
"@jasonpincin/standard": "~5.3.1-3",
"eventuate-once": "~1.1.0",
"faucet": "0.0.1",
"istanbul": "~0.4.0",
"lower-standard": "~8.0.0-2",
"opn": "~1.0.2",

@@ -27,0 +27,0 @@ "phantomjs-prebuilt": "~2.1.7",

@@ -44,3 +44,3 @@ callback-timeout

Returns a callback function that will execute after `ms` milliseconds with a single `TimeoutError` argument if not invoked by other means first. If the `ms` timeout argument is omitted, 0, or null, then the timeout is disabled and the original callback is returned. `msg` may be used to set a custom error message (on timeout), otherwise an appropriate one will be set for you.
Returns a callback function that will execute after `ms` milliseconds with a single `TimeoutError` argument if not invoked by other means first. If the `ms` timeout argument is omitted, 0, or null, then the timeout is disabled and the original callback is returned. `msg` may be used to set a custom error message (on timeout), otherwise an appropriate one will be set for you. If `false` is set for the timeout message the callback is returned without an error (null, on timeout).

@@ -47,0 +47,0 @@ ### TimeoutError

Sorry, the diff of this file is not supported yet

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