1.0.2 • Published 3 years ago

try-ports v1.0.2

Weekly downloads
16
License
MIT
Repository
github
Last release
3 years ago

npm-try-ports

try port eg. 8888, if in use try port +1, rinse and repeat.

usage

npm i try-ports

or

npm i -D try-ports

const tryPorts = require("try-ports");

tryPorts(8888, port => {
	// callback with port equal to whatever port was free, starting at 8888
	// rest of your code goes here
}