UNPKG

express-port-switcher

Version:

A smart port management tool that automatically finds and forwards to available ports when preferred ports are in use

15 lines (14 loc) 528 B
/// <reference types="node" /> import { EventEmitter } from 'events'; import { PortManagerOptions } from '../types'; export declare class PortManager extends EventEmitter { private static instance; private activePorts; private readonly defaultPort; private readonly maxPortAttempts; private constructor(); static getInstance(options?: PortManagerOptions): PortManager; allocatePort(desiredPort?: number): Promise<number | null>; releasePort(port: number): void; getActivePorts(): number[]; }