Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geerlingguy/jjg-node-ping
A simple ping wrapper for Node.js which returns the latency and result of a ping to a given address.
https://github.com/geerlingguy/jjg-node-ping
latency library node node-ping nodejs npm ping
Last synced: 12 days ago
JSON representation
A simple ping wrapper for Node.js which returns the latency and result of a ping to a given address.
- Host: GitHub
- URL: https://github.com/geerlingguy/jjg-node-ping
- Owner: geerlingguy
- License: mit
- Created: 2013-06-07T03:05:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-07-10T23:04:08.000Z (over 1 year ago)
- Last Synced: 2024-10-10T04:06:13.771Z (29 days ago)
- Topics: latency, library, node, node-ping, nodejs, npm, ping
- Language: JavaScript
- Size: 20.5 KB
- Stars: 10
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# JJG Ping
JJG Ping is a simple ping wrapper for Node.js which returns the latency and result of a ping to a given address.
Ping was created by [Jeff Geerling](http://www.lifeisaprayer.com/) of [Midwestern Mac, LLC](http://www.midwesternmac.com/) in 2013.
## Installation
Use NPM:
$ npm install jjg-ping
## Usage
// Use the jjg-ping library.
var ping = require('jjg-ping');// Ping google.com.
ping.system.ping('google.com', function(latency, status) {
if (status) {
// Host is reachable/up. Latency should have a value.
console.log('Google is reachable (' + latency + ' ms ping).');
}
else {
// Host is down. Latency should be 0.
console.log('Google is unreachable.');
}
});## Why jjg-ping?
Because npm [doesn't support namespacing](https://npmjs.org/doc/faq.html#Why-no-namespaces), and ping, node-ping, and all the other namespaces I wanted were already taken.
## License
JJG Ping is licensed under the MIT (Expat) license. See included LICENSE.md.