Is there a way to hang/pause the function in the middle of its execution and then continue after few things are handled(input from the user received through socket.io) in node js? I know this is bad practice and need to use promises, async/await etc. However, according to the functionality of my program, I need to handle it this way.
My original question where I shared my code is here: Node application interactively get user input from react front end by pausing the current execution