New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

timeout-signal

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timeout-signal

Create an AbortSignal that aborts after a delay.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

timeout-signal Travis CI Build Status

Create an AbortSignal that aborts after a delay.

NPM Badge

Install

npm install timeout-signal

Usage

const timeoutSignal = require("timeout-signal");
const fetch = require("cross-fetch");

fetch("https://www.google.com", { signal: timeoutSignal(5000) })
	.then(response => {
		// Handle response
	})
	.catch(error => {
		if (error.message === "The user aborted a request.") {
			// Handle abortion
		}
	})

API

timeoutSignal(timeout)

timeout

Type: integer

The milliseconds to wait.

Keywords

FAQs

Package last updated on 24 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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