New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

web-ping

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-ping

JavaScript ping API for use in a web browser context. Released under the BSD-3-Clause license, see LICENSE.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

web-ping

JavaScript ping API for use in a web browser context. Released under the BSD-3-Clause license, see LICENSE.

Installation

npm install --save web-ping

Usage

/**
 * Pings a url.
 * @param  {String} url
 * @param  {Number} multiplier - optional, factor to adjust the ping by.  0.3 works well for HTTP servers.
 * @return {Promise} promise that resolves to a ping (ms, float).
 */

Example:

ping('https://google.com/').then(function(delta) {
    console.log('Ping time was ' + String(delta) + ' ms');
}).catch(function(err) {
    console.error('Could not ping remote URL', err);
});

Caveats

The user should be aware that this method relies on the HTTP protocol to ping remote URLs. Consequently, ping times are not as reliable as if they were performed using the ICMP protocol.

FAQs

Package last updated on 18 Apr 2017

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