Node.js program is terminated when the event loop is empty. If I use http module and create a server without any callback to be added to event loop, th
The "answer" here doesn't actually answer the question at all. The real explanation is refs, which Node's event loop uses to keep track of async actions and whether it can or cannot close the process.
Answered here in more detail: https://stackoverflow.com/a/51571024/8182008