find-port

3.0.0 • Public • Published

find-port

find an unused port in your localhost

	var findPort = require('find-port')

	// scan a range
	findPort('127.0.0.1', 8000, 8003, function(ports) {
		console.log(ports)
	})

	// scan explicitly
	findPort('127.0.0.1', [8000, 8011], function(ports) {
		console.log(ports)
	})
  • Since version 2.0.0 a local interface must be specified
  • This module is not designed to scan remote ports only local ones.

Package Sidebar

Install

npm i find-port

Weekly Downloads

3,749

Version

3.0.0

License

MIT

Unpacked Size

4.42 kB

Total Files

5

Last publish

Collaborators

  • kessler
  • yaniv