
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
cordova-plugin-ping
Advanced tools
This plugin implements the ping
software utility.
cordova plugin add cordova-plugin-ping
or
cordova plugin add https://github.com/t1st3/cordova-plugin-ping.git
This plugin defines a global Ping
object.
Although the object is in the global scope, it is not available until after the deviceready
event.
- query : Domain or IP address to ping.
- timeout : Time to wait for a response, in seconds.
- retry : Number of echo requests to send.
- version : Ping IPv4 or IPv6 address (Ping or Ping6).
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
var p, success, err, ipList;
ipList = [{query: 'www.tiste.org', timeout: 1,retry: 3,version:'v4'},
{query: 'www.somesite.com', timeout: 2,'retry': 3,version:'v6'}];
success = function (results) {
console.log(results);
};
err = function (e) {
console.log('Error: ' + e);
};
p = new Ping();
p.ping(ipList, success, err);
}
This method takes the following arguments:
The callback function for success takes one argument, which is a JSON array of results:
[{
"response": {
"status": "success",
"result": {
"target": "www.tiste.org",
"avgRtt": "4.476",
"maxRtt": "6.348",
"minRtt": "1.007",
"pctTransmitted": "3",
"pctReceived": "3",
"pctLoss": "0%"
}
},
"request": {
"query": "www.tiste.org",
"timeout": "1",
"retry": "3",
"version": "v4"
}
}, {
"response": {
"status": "success",
"result": {
"target": "www.somesite.com",
"avgRtt": "4.811",
"maxRtt": "7.294",
"minRtt": "0.915",
"pctTransmitted": "3",
"pctReceived": "3",
"pctLoss": "0%"
}
},
"request": {
"query": "www.somesite.com",
"timeout": "2",
"retry": "3",
"version": "v6"
}
}]
The callback function for error takes one argument, which is the error emitted.
This project is licensed under the MIT license. Check the license file.
FAQs
Cordova Ping Plugin
The npm package cordova-plugin-ping receives a total of 49 weekly downloads. As such, cordova-plugin-ping popularity was classified as not popular.
We found that cordova-plugin-ping 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.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.