0.2.1 • Published 10 years ago

tk-ping v0.2.1

Weekly downloads
15
License
-
Repository
github
Last release
10 years ago

#NODE-PING a ping wrapper for nodejs

#LICENSE MIT

(C) Daniel Zelisko

http://github.com/danielzzz/node-ping

#DESCRIPTION

node-ping is a simple wrapper for the system ping utility

#INSTALLATION

npm install ping

#USAGE

##Promise wrapper

var ping = require("../index");

var hosts = ['192.168.1.1', 'google.com', 'yahoo.com'];

hosts.forEach(function (host) {
    ping.promise.probe(host)
        .then(function(res) {
            console.log(host, res.alive, res.ms + ' ms');
        })
        .catch(function(e) {
            console.log('couldn\'t reach', host, e);
        })
});

##Promise Wrapper with configable ping options

//Only promise wrapper supports configable ping options
hosts.forEach(function (host) {
    ping.promise.probe(host, {
        timeout: 10,
        extra: ["-i 2"]
    }).then(function (res) {
            console.log(res);
        });
});
0.2.1

10 years ago

0.2.0

10 years ago

0.1.9

10 years ago