Question
What is the type signature of the main exported function?
About sindresorhus/get-port · 2 messages · last activity 5/18/2026
What is the type signature of the main exported function?
The main exported function getPort has the following type signature [index.d.ts:L66]:
export default function getPort(options?: Options): Promise<number>;
This function:
Options parameterPromise that resolves to a number (the available TCP port)The Options type is defined in [index.d.ts:L3-L65] and includes several optional properties:
port: A preferred port or iterable of preferred portsexclude: Ports that should not be returnedreserve: Whether to lock the port for the process lifetime (default: false)host: The specific host to check port availability onFOLLOW_UPS:
reserve option do exactly?exclude option work?Want to ask your own question?
Open chat for sindresorhus/get-port →Public Q&A. Generated by RepoPilot from the actual source of sindresorhus/get-port. AI answers can be incomplete or stale — verify before relying on them.