3.1.1 • Published 8 years ago
porty v3.1.1
Porty
Porty quickly and easily find available ports.
Install
npm i porty --save
Example
const port = await Porty.find({
min: 8080,
max: 8090,
avoids: [8081, 8080, 8082, 8083, 8084]
});
console.log(port); // 8085Porty.test(port)
Tests if a port is in use. Returns a boolean.
port: Numberport to test
Porty.find(options,)
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: Numberport number to start (default: 8,000) -max: Numberport number to end (default: 10,000) -avoids: Arrayarray of port numbers to avoidmin: Numbermax: Numberavoids: 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