Question
What is the type signature of the main exported function?
About sindresorhus/get-port · 2 messages · last activity 9/1/2026
What is the type signature of the main exported function?
The main exported function getPort has the following type signature:
export default function getPort(options?: Options): Promise<number>;
[index.d.ts:L66]
This function returns a Promise that resolves to a number representing an available TCP port. The options parameter is optional and of type Options, which allows you to specify preferences like:
port: a preferred port number or iterable of port numbersexclude: ports to skipreserve: whether to lock the port for the process lifetimehost: a specific host to check availability onFOLLOW_UPS:
Want to ask your own question?
Open chat for sindresorhus/get-portPublic 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.