import parseArgs from 'minimist' ; import { TGetServerPortFromCLIArgs } from '../../types' ; /**
 * Returns the server port from the CLI args.
 * Fallback to 3002 which is hardcoded for development usage in many files
 */ const getServerPortFromCLIArgs = ( ) => { const rawArgs = process . argv . slice ( 2 ) ; const parsedArguments = parseArgs ( rawArgs ) ; const cliPort = ( parsedArguments . port || parsedArguments . p ) as string ; return Number ( cliPort || 3002 ) ; } ; export default getServerPortFromCLIArgs ;