Porty
Porty quickly and easily find available ports.
Install
npm i porty --save
Example
const port = await Porty; console; // 8085
Porty.test(port)
Tests if a port is in use. Returns a boolean.
port: Number
port to test
Porty.find([options,] [min, max, avoids])
Arguments can be a single object or one/two number arguments. All arguments are optional. Return value is a open port number >= min <= max
.
options: Object
min: Number
port number to start (default: 8,000)max: Number
port number to end (default: 10,000)avoids: Array
array of port numbers to avoid
min: Number
max: Number
avoids: Array
Porty.get
Alias for Porty.find
Authors
License
Why You Should Choose MPL-2.0 This project is licensed under the MPL-2.0 License