http-party / node-portfinder

A simple tool to find an open port or domain socket on the current machine
https://github.com/http-party/node-portfinder
Other
887 stars 95 forks source link

Add promise version of getPorts function #146

Open MasterOdin opened 1 year ago

MasterOdin commented 1 year ago

PR adds a new getPortsPromise function to allow using a promisified version of getPorts, similar to how there's a getPortPromise version of getPort. A test is included for the function, which mimics what I saw for testing getPortPromise.

I also fixed a type error which made it seem like the options parameter was required for getPorts, where it's optional, just need to always pass the count and callback.