npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

jjg-ping

1.0.3 • Public • Published
Ping for Node.js Logo

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 of Midwestern Mac, LLC 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, 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.

install

npm i jjg-ping

Downloadsweekly downloads

49

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability