pinging

Pinging Js style

Usage no npm install needed!

<script type="module">
  import pinging from 'https://cdn.skypack.dev/pinging';
</script>

README

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.