async function getPort(options) {
	// Account for `port = 0`
	const userPort = typeof options.port === 'number' ? options.port : process.env.PORT;
	if (userPort !== undefined) {
		if (await isPortFree(+userPort)) {
			return +userPort;
		}

		throw new Error(`Another process is already running on port ${userPort}. Please choose a different port.`);
	}

	return await getFreePort(8080);
}
Check if the user specified port is available and
throw if it is taken. If the user didn't specify
a port we'll try to find a free one
@param {{port?: number | string}} options