Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodejs-traceroute

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodejs-traceroute - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

35

example.js

@@ -5,18 +5,21 @@ 'use strict';

const tracer = new Traceroute();
try {
const tracer = new Traceroute();
tracer
.on('pid', (pid) => {
console.log(`pid: ${pid}`);
})
.on('destination', (destination) => {
console.log(`destination: ${destination}`);
})
.on('hop', (hop) => {
console.log(`hop: ${JSON.stringify(hop)}`);
})
.on('close', (code) => {
console.log(`close: code ${code}`);
});
tracer
.on('pid', (pid) => {
console.log(`pid: ${pid}`);
})
.on('destination', (destination) => {
console.log(`destination: ${destination}`);
})
.on('hop', (hop) => {
console.log(`hop: ${JSON.stringify(hop)}`);
})
.on('close', (code) => {
console.log(`close: code ${code}`);
});
tracer.trace('github.com');
tracer.trace('github.com');
} catch (ex) {
console.log(ex);
}
{
"name": "nodejs-traceroute",
"version": "0.1.1",
"version": "0.1.2",
"description": "Node.js wrapper around tracert and traceroute process",

@@ -19,3 +19,6 @@ "main": "index.js",

"traceroute"
]
],
"dependencies": {
"validator": "^5.5.0"
}
}

@@ -6,2 +6,3 @@ 'use strict';

const readline = require('readline');
const validator = require('validator');

@@ -17,2 +18,6 @@ class Process extends events.EventEmitter {

trace(domainName) {
if (!this.isValidDomainName(domainName)) {
throw "Invalid domain name or IP address";
}
this.args.push(domainName);

@@ -51,2 +56,6 @@

isValidDomainName(domainName) {
return validator.isFQDN(domainName + '') || validator.isIP(domainName + '');
}
parseDestination(data) {}

@@ -53,0 +62,0 @@ parseHop(hopData) {}

@@ -13,19 +13,22 @@ # nodejs-traceroute

const tracer = new Traceroute();
try {
const tracer = new Traceroute();
tracer
.on('pid', (pid) => {
console.log(`pid: ${pid}`);
})
.on('destination', (destination) => {
console.log(`destination: ${destination}`);
})
.on('hop', (hop) => {
console.log(`hop: ${JSON.stringify(hop)}`);
})
.on('close', (code) => {
console.log(`close: code ${code}`);
});
tracer
.on('pid', (pid) => {
console.log(`pid: ${pid}`);
})
.on('destination', (destination) => {
console.log(`destination: ${destination}`);
})
.on('hop', (hop) => {
console.log(`hop: ${JSON.stringify(hop)}`);
})
.on('close', (code) => {
console.log(`close: code ${code}`);
});
tracer.trace('github.com');
tracer.trace('github.com');
} catch (ex) {
console.log(ex);
}
```

@@ -32,0 +35,0 @@

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