It says on the Node.js about page:
Node exits the event loop when there are no more callbacks to perform.
Is there a way to find out which callbacks are keeping Node from exiting?
You can use process._getActiveHandles() and process._getActiveRequests()
process._getActiveHandles()
process._getActiveRequests()
See this discussion in node.js mailing list.
update: there is a good package for this - https://github.com/mafintosh/why-is-node-running
2.1m questions
2.1m answers
60 comments
57.0k users