UNPKG

@oxog/port-finder

Version:

Zero-dependency port finder for Node.js applications with plugin support

27 lines 1.27 kB
import { PortFinderOptions } from './types'; /** * Checks if a specific port is available * @param port - The port number to check * @param host - The host to bind to (default: '0.0.0.0') * @returns Promise resolving to true if port is available, false otherwise */ export declare function isPortAvailable(port: number, host?: string): Promise<boolean>; /** * Finds a single available port * @param options - Port finder options * @returns Promise resolving to an available port number * @throws {PortFinderError} If no available port is found */ export declare function findPort(options?: PortFinderOptions): Promise<number>; /** * Finds multiple available ports * @param count - Number of ports to find * @param options - Port finder options * @returns Promise resolving to an array of available port numbers * @throws {PortFinderError} If not enough available ports are found */ export declare function findPorts(count: number, options?: PortFinderOptions): Promise<number[]>; export { addValidator, removeValidator, getValidator, applyValidators, builtInValidators } from './validators'; export { validatePort, validatePortRange, checkPort, scanPorts, scanPortsParallel } from './core'; export * from './types'; //# sourceMappingURL=index.d.ts.map