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

@types/wait-on

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/wait-on

TypeScript definitions for wait-on

  • 5.3.4
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @types/wait-on?

@types/wait-on is a TypeScript type definition package for the wait-on library, which is used to wait for various resources to become available before proceeding. This can include HTTP(s) endpoints, TCP ports, file paths, and more.

What are @types/wait-on's main functionalities?

Wait for HTTP(s) endpoints

This feature allows you to wait for HTTP or HTTPS endpoints to become available. The code sample demonstrates how to wait for a local server and an external website to be accessible.

const waitOn = require('wait-on');

const opts = {
  resources: [
    'http://localhost:3000',
    'https://example.com'
  ]
};

waitOn(opts, function (err) {
  if (err) { return handleError(err); }
  // HTTP(s) endpoints are now available
});

Wait for TCP ports

This feature allows you to wait for a specific TCP port to be available. The code sample demonstrates how to wait for a TCP port on localhost.

const waitOn = require('wait-on');

const opts = {
  resources: [
    'tcp:localhost:8080'
  ]
};

waitOn(opts, function (err) {
  if (err) { return handleError(err); }
  // TCP port is now available
});

Wait for file paths

This feature allows you to wait for a specific file path to become available. The code sample demonstrates how to wait for a file to be created or become accessible.

const waitOn = require('wait-on');

const opts = {
  resources: [
    'file:/path/to/file.txt'
  ]
};

waitOn(opts, function (err) {
  if (err) { return handleError(err); }
  // File path is now available
});

Wait for multiple resources

This feature allows you to wait for multiple types of resources simultaneously. The code sample demonstrates how to wait for an HTTP endpoint, a TCP port, and a file path all at once.

const waitOn = require('wait-on');

const opts = {
  resources: [
    'http://localhost:3000',
    'tcp:localhost:8080',
    'file:/path/to/file.txt'
  ]
};

waitOn(opts, function (err) {
  if (err) { return handleError(err); }
  // All resources are now available
});

Other packages similar to @types/wait-on

FAQs

Package last updated on 07 Nov 2023

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