Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@types/wait-on
Advanced tools
TypeScript definitions for 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.
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
});
wait-for-it is a pure bash script that will wait on the availability of a host and TCP port. It is useful for shell scripting and is more lightweight compared to wait-on, but it does not support waiting for HTTP endpoints or file paths.
wait-for-localhost is a Node.js package that waits for localhost to be ready. It is simpler and more focused compared to wait-on, as it only supports waiting for localhost and does not handle other types of resources like file paths or external HTTP endpoints.
tcp-ping is a Node.js package that pings a TCP port to check its availability. It is more specialized compared to wait-on, focusing solely on TCP ports and not supporting other resource types like HTTP endpoints or file paths.
npm install --save @types/wait-on
This package contains type definitions for wait-on (https://github.com/jeffbski/wait-on#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wait-on.
These definitions were written by Ifiok Jr., and Andrew Leedham.
FAQs
TypeScript definitions for wait-on
The npm package @types/wait-on receives a total of 687,296 weekly downloads. As such, @types/wait-on popularity was classified as popular.
We found that @types/wait-on demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.