code: function onPortSelectInput(newPort) {
  			newPort = newPort.replace(/\n/g, ""); newPort = newPort.replace(/\r/g, "");
  			var portExists = false;
  			for(var i=0; i < ports.length; i++) if(newPort == ports[i].comName) { portExists = true; break; }
  			if(!portExists && Number(newPort) && ports[Number(newPort)-1]) {
  				newPort = ports[Number(newPort)-1].comName; portExists = true;
  			}
  			if(portExists) {
  				console.log(chalk.bgGreen.black("Listening on port \""+newPort+"\""));
  				process.stdin.removeListener('data', onPortSelectInput);
  				console.log(); callback(newPort);
  			} else {
  				console.log(chalk.bgRed.black("Port \""+newPort+"\" does not exist!"));
  			}
  		}
docs: Wait for user input: