try-ports

1.0.2 • Public • Published

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i try-ports

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

2.56 kB

Total Files

4

Last publish

Collaborators

  • paul-browne