Node.js · Senior · Question 48 of 75

A Node.js process doesn't exit after the main script finishes. What's the usual reason?

Explanation

Close pools and servers explicitly. process.getActiveResourcesInfo() lists what keeps the loop alive, and unref() lets background timers not hold it.

Further reading

Problem with a question

Node.js · Senior · question 48

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz