Is possible to run node.js with timeout? In my script I am connecting to external services which sometimes don't respond. Then my script hangs and the node.js process hangs.
I would like to force exit process after 5 minutes no matter if there is an error, if the process hangs or if everything is being done correctly.
It is independent of the services I use. I just want to kill the script after 5 minutes in any situation.