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.0
  • ts3.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
896K
decreased by-22.3%
Maintainers
1
Weekly downloads
 
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 16 May 2021

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