find-port

find an unused port in your localhost

MIT 5 个版本
安装
npm install find-port
yarn add find-port
pnpm add find-port
bun add find-port
README

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.
版本列表
3.0.0 2022-05-13
2.0.1 2016-04-04
1.0.1 2015-02-11
1.0.0 2014-04-16
0.0.3 2014-01-18