Finds multiple open ports after your specified base ports, and below the max range.
If not all ports could be found, the error callback is triggered.
npm install get-ports --save
ports array is parallel to your input (base) ports.
For example, if port
9966 are already in use:
var getPorts =
For the given array of
basePorts, tries to find the next available port from each one. This keeps track of available ports to ensure there are no conflicts in the final result.
If the finite number
maxPort is specified, the portfinding will fail when it reaches that maximum port. Defaults to 60000.
The callback is called with
(err, ports), where
err will be an Error if any of the portfindings failed (i.e. no open ports within range). If successful,
err will be null and
ports will be an array, parallel to
basePorts, with the found port numbers.
MIT, see LICENSE.md for details.