LogoRobo.js
Packages@robojs/server

isPortAvailable()

Function: isPortAvailable()

function isPortAvailable(port, hostname): Promise<boolean>

Check if a specific port is available on the given hostname

Parameters

ParameterTypeDefault valueDescription
portnumberundefinedPort number to check
hostnamestring'localhost'Hostname to bind to (defaults to 'localhost')

Returns

Promise<boolean>

Promise<boolean> - true if port is available, false if in use

On this page