New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qtraceroute

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qtraceroute

Wrapper around native traceroute command using promises (Q) based on https://github.com/jaw187/node-traceroute

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

qtraceroute

Simple wrapper around native traceroute command using promises (Q). A trace in node will return an array of hops. Each hop contains the hosts in that hop and the respective round trip times of each host.

The main difference in this implementation is that it will give you live results as they are received.

Install

$ npm install qtraceroute

Example

traceroute = require('./traceroute');

var ip = '8.8.8.8'
console.log('test trace of '+ip);
var promise = traceroute.trace(ip);
promise.fail(function(e) {
	"use strict";
	console.log('fail');
	console.log(e);
});


promise.progress(function (data) {
	"use strict";
	console.log(data);
});

promise.fail(function (message) {
	"use strict";
//	console.log(message);
});

promise.then(function (hops) {
	"use strict";
	console.log("Done ");
	console.log("Hops: " + hops.length);
	console.log(hops);
});

This example would write the following to the console if run from my network...

test trace of 8.8.8.8
{ host: '8.8.8.8',
  hop: '192.168.42.1',
  time: 98.142,
  hopCount: 0 }
{ host: '8.8.8.8',
  hop: '105.236.3.193',
  time: 109.055,
  hopCount: 1 }
{ host: '8.8.8.8',
  hop: '41.181.178.77',
  time: 118.899,
  hopCount: 2 }
{ host: '8.8.8.8',
  hop: '196.44.31.120',
  time: 120.69,
  hopCount: 3 }
{ host: '8.8.8.8',
  hop: '196.44.0.42',
  time: 118.652,
  hopCount: 4 }
{ host: '8.8.8.8',
  hop: '41.181.165.115',
  time: 109.449,
  hopCount: 5 }
{ host: '8.8.8.8',
  hop: '72.14.194.74',
  time: 112.696,
  hopCount: 6 }
{ host: '8.8.8.8',
  hop: '66.249.95.8',
  time: 276.964,
  hopCount: 7 }
{ host: '8.8.8.8',
  hop: '209.85.244.240',
  time: 251.944,
  hopCount: 8 }
{ host: '8.8.8.8',
  hop: '66.249.95.173',
  time: 300.377,
  hopCount: 9 }
{ host: '8.8.8.8',
  hop: '72.14.236.191',
  time: 298.768,
  hopCount: 10 }
{ host: '8.8.8.8',
  hop: 'Request timed out',
  time: 0,
  hopCount: 11 }
{ host: '8.8.8.8', hop: '8.8.8.8', time: 301.201, hopCount: 12 }
Done
Hops: undefined
{ satus: true,
  hops:
   [ { hop: '192.168.42.1', time: 98.142, hopCount: 0 },
     { hop: '105.236.3.193', time: 109.055, hopCount: 1 },
     { hop: '41.181.178.77', time: 118.899, hopCount: 2 },
     { hop: '196.44.31.120', time: 120.69, hopCount: 3 },
     { hop: '196.44.0.42', time: 118.652, hopCount: 4 },
     { hop: '41.181.165.115', time: 109.449, hopCount: 5 },
     { hop: '72.14.194.74', time: 112.696, hopCount: 6 },
     { hop: '66.249.95.8', time: 276.964, hopCount: 7 },
     { hop: '209.85.244.240', time: 251.944, hopCount: 8 },
     { hop: '66.249.95.173', time: 300.377, hopCount: 9 },
     { hop: '72.14.236.191', time: 298.768, hopCount: 10 },
     { hop: 'Request timed out', time: 0, hopCount: 11 },
     { hop: '8.8.8.8', time: 301.201, hopCount: 12 } ],
  host: '8.8.8.8',
  hopCount: 13 }

Keywords

FAQs

Package last updated on 12 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc