ip-trace
v0.1.1
Published
A npm module that uses traceroute to find routed routes to a destination. A more detailed way to use this library is in './test'.
Downloads
4
Readme
ip-trace
A npm module that uses traceroute to find routed routes to a destination. A more detailed way to use this library is in './test'.
Installation
npm install ip-trace
Start
import {Hop, iptrace} from 'ip-trace'
const tracer = iptrace('naver.com');
const maxHop = 5;
tracer.onHop((hop: Hop) => {
if(hop.hop >= maxHop){
tracer.end();
}
/** result:
* 192.168.0.1 14.376 ms
* 123.100.176.1 9.364 ms
* 119.77.96.53 11.235 ms
* 119.77.96.33 7.958 ms
* 123.111.216.229 7.674 ms
*/
console.log(hop.ip.address + " " + hop.time);
}).onClose((msg) => {
/**
* result : null
*/
console.log(msg);
}).start();
Testing
npm run test
To do
- [ ] support windows