package
Asynchronous port scanner for Node.js
npm install portscannerGitHub-flavored package documentation.
Across all versions, last 30 days.
8,796,372 in 30 days
Runtime metadata.
Tagged topics.
The portscanner module is an asynchronous JavaScript port scanner for Node.js.
Portscanner can check a port, or range of ports, for 'open' or 'closed' statuses.
npm install portscannerA brief example:
var portscanner = require('portscanner')
// Checks the status of a single port
portscanner.checkPortStatus(3000, '127.0.0.1', function(error, status) {
// Status is 'open' if currently in use or 'closed' if available
console.log(status)
})
// Find the first available port. Asynchronously checks, so first port
// determined as available is returned.
portscanner.findAPortNotInUse(3000, 3010, '127.0.0.1', function(error, port) {
console.log('AVAILABLE PORT AT: ' + port)
})
// Find the first port in use or blocked. Asynchronously checks, so first port
// to respond is returned.
portscanner.findAPortInUse(
The example directory contains a more detailed example.
npm testPlease create issues or pull requests for port scanning related features you'd like to see included.
Estimated unpacked size across 4 packages.
811.3 kB
Includes dependencies.
laggingreflex
laggingreflex@gmail.com
^1.0.3
1.0.8