portscanner
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -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 @@ }) |
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
1
8626
5