pinging

0.0.4 • Public • Published

PingingJS

Pinging, JS style.

PingingJS is a fully-implemented ping function, using raw sockets and when.js.

Please note: using raw-sockets requires root on linux/OSX machines.

Getting PingingJS

npm install pinging

Usage

var ping = require('pinging');

ping('8.8.8.8', {
	count: 4, // send 4 pings,
	timeout: 1000, // timeout ping after 1 second
	payload: 'PingingJSIsAwesome', // send the truth as the ping's payload
})
.then(function (stats) {
	console.log('Pings sent:' + stats.pingsSent);
	console.log('Pings recieved:' + stats.pingsRecieved);
})
.catch(function (err) {
	console.log('This ping had a boo-boo...');
});

For more advanced examples, please see the scripts directory.

How fast is it?

Very.

Readme

Keywords

none

Package Sidebar

Install

npm i pinging

Weekly Downloads

2

Version

0.0.4

License

BSD-2-Clause

Last publish

Collaborators

  • oakfang