evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
A utility that finds an available TCP port by scanning hosts in priority order, combining caller-provided hosts with the dependency's default host detection while skipping invalid entries.
export interface PortRequestOptions {
startPort?: number;
stopPort?: number;
hosts?: Array<string | null>;
}
export interface PortAssignment {
port: number;
host: string | null;
}
/**
* Locate the first available TCP port within the provided bounds, scanning hosts in order.
* Custom hosts (if provided) are merged with the dependency's default host detection.
* Invalid or unbindable hosts are skipped unless all hosts are invalid, in which case an error is thrown.
*/
export function findAvailablePort(options?: PortRequestOptions): Promise<PortAssignment>;Discovers available TCP ports by scanning host lists and port ranges, including default host detection and invalid-host pruning. @satisfied-by