What is nodemon?

Why Interviewers Ask This

Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Node.js basics — a prerequisite for any developer role.

Answer

nodemon is a development utility tool that monitors your Node.js application for file changes and automatically restarts the server whenever changes are detected. Without nodemon, you would have to manually stop and restart Node.js every time you change a file during development. Install as a dev dependency: npm install --save-dev nodemon. Use it instead of node: nodemon app.js. Configure via nodemon.json or the nodemonConfig field in package.json to specify which file extensions and directories to watch, and which to ignore. Typically added to the dev script in package.json: "dev": "nodemon app.js". An alternative built into Node.js 18+ is node --watch, which provides similar file-watching functionality without an extra dependency.

Common Mistake

Many candidates answer correctly but can't explain the 'why'. Always be prepared to justify your answer with a concrete example or use case from your Node.js experience.