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

portscanner

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

portscanner - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

20

lib/portscanner.js

@@ -14,3 +14,3 @@ var net = require('net')

* Defaults to 65535.
* @param {String} host - Where to scan. Defaults to 'localhost'.
* @param {String} host - Where to scan. Defaults to '127.0.0.1'.
* @param {Function} callback - function (error, port) { ... }

@@ -34,3 +34,3 @@ * - {Object|null} error - Any errors that occurred while port scanning.

* Defaults to 65535.
* @param {String} host - Where to scan. Defaults to 'localhost'.
* @param {String} host - Where to scan. Defaults to '127.0.0.1'.
* @param {Function} callback - function (error, port) { ... }

@@ -52,5 +52,5 @@ * - {Object|null} error - Any errors that occurred while port scanning.

* @param {String|Object} options - host or options
* - {String} host - Host of where to scan. Defaults to 'localhost'.
* - {String} host - Host of where to scan. Defaults to '127.0.0.1'.
* - {Object} options
* - {String} host - Host of where to scan. Defaults to 'localhost'.
* - {String} host - Host of where to scan. Defaults to '127.0.0.1'.
* - {Number} timeout - Connection timeout. Defaults to 400ms.

@@ -68,3 +68,3 @@ * @param {Function} callback - function (error, port) { ... }

var host = options.host || 'localhost'
var host = options.host || '127.0.0.1'
var timeout = options.timeout || 400

@@ -122,9 +122,9 @@

numberOfPortsChecked++
if (error) {
if (statusOfPort === status) {
foundPort = true
callback(error, port)
}
else if (error) {
callback(error)
}
else if (statusOfPort === status) {
foundPort = true
callback(null, port)
}
else {

@@ -131,0 +131,0 @@ port++

@@ -1,27 +0,43 @@

{ "name" : "portscanner"
, "description" : "Asynchronous port scanner for Node.js"
, "keywords" : [ "portscanner", "port", "scanner", "checker", "status" ]
, "version" : "0.2.0"
, "preferGlobal" : false
, "homepage" : "https://github.com/baalexander/node-portscanner"
, "author" : [
"Brandon Alexander <baalexander@gmail.com> (https://github.com/baalexander)"
, "Sean Massa <endangeredmassa@gmail.com> (http://massalabs.com)"
]
, "repository" :
{ "type" : "git"
, "url" : "git://github.com/baalexander/node-portscanner.git"
}
, "bugs" : { "url" : "https://github.com/baalexander/node-portscanner/issues" }
, "directories" : { "lib" : "./lib" }
, "main" : "./lib/portscanner.js"
, "dependencies" : { "async" : "0.1.15" }
, "devDependencies" : { }
, "engines" : { "node" : ">=0.4", "npm" : ">=1.0.0" }
, "licenses" :
[ { "type" : "MIT"
, "url" : "https://github.com/baalexander/node-portscanner/raw/master/LICENSE"
{
"name": "portscanner",
"description": "Asynchronous port scanner for Node.js",
"keywords": [
"portscanner",
"port",
"scanner",
"checker",
"status"
],
"version": "0.2.1",
"preferGlobal": false,
"homepage": "https://github.com/baalexander/node-portscanner",
"author": [
"Brandon Alexander <baalexander@gmail.com> (https://github.com/baalexander)",
"Sean Massa <endangeredmassa@gmail.com> (http://massalabs.com)"
],
"repository": {
"type": "git",
"url": "git://github.com/baalexander/node-portscanner.git"
},
"bugs": {
"url": "https://github.com/baalexander/node-portscanner/issues"
},
"directories": {
"lib": "./lib"
},
"main": "./lib/portscanner.js",
"dependencies": {
"async": "0.1.15"
},
"devDependencies": {},
"engines": {
"node": ">=0.4",
"npm": ">=1.0.0"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/baalexander/node-portscanner/raw/master/LICENSE"
}
]
}

@@ -25,3 +25,3 @@

// Checks the status of a single port
portscanner.checkPortStatus(3000, 'localhost', function(error, status) {
portscanner.checkPortStatus(3000, '127.0.0.1', function(error, status) {
// Status is 'open' if currently in use or 'closed' if available

@@ -33,3 +33,3 @@ console.log(status)

// determined as available is returned.
portscanner.findAPortNotInUse(3000, 3010, 'localhost', function(error, port) {
portscanner.findAPortNotInUse(3000, 3010, '127.0.0.1', function(error, port) {
console.log('AVAILABLE PORT AT: ' + port)

@@ -40,3 +40,3 @@ })

// to respond is returned.
portscanner.findAPortInUse(3000, 3010, 'localhost', function(error, port) {
portscanner.findAPortInUse(3000, 3010, '127.0.0.1', function(error, port) {
console.log('PORT IN USE AT: ' + port)

@@ -43,0 +43,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