Comparing version 1.3.1 to 1.3.2
@@ -1,2 +0,2 @@ | ||
const icmp = require('icmp'); | ||
const icmp = require('../'); | ||
const readline = require('readline'); | ||
@@ -18,5 +18,5 @@ | ||
} catch (e) { | ||
console.log(host, 'Error'); | ||
console.log(host, console.log(e)); | ||
} | ||
}, 1000); | ||
}); |
10
index.js
@@ -31,3 +31,3 @@ const raw = require('raw-socket'); | ||
if (!this.ip) { | ||
if (net.isIPv4(this.ip)) { | ||
if (net.isIPv4(this.host)) { | ||
this.ip = this.host; | ||
@@ -68,9 +68,11 @@ return resolve(); | ||
this.start = process.hrtime()[1]; | ||
this.start = process.hrtime(); | ||
}); | ||
this.socket.on('message', (buffer, source) => { | ||
this.end = process.hrtime()[1]; | ||
this.elapsed = (this.end - this.start) / 1000000; | ||
const NS_PER_SEC = 1e9; | ||
this.diff = process.hrtime(this.start); | ||
this.elapsed = (this.diff[0] + this.diff[1] / NS_PER_SEC) * 1000; | ||
const offset = 20; | ||
@@ -77,0 +79,0 @@ const type = buffer.readUInt8(offset); |
{ | ||
"name": "icmp", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Internet Control Message Protocol in Node", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10165
197