--watch

Last updated

What is --watch?

The --watch flag in Node.js is a powerful feature introduced in Node.js version 19 that enables automatic reloading of your Node.js application whenever changes are detected in the specified files.

Here's How it works:

  • You run your Node.js script with the --watch flag: $ node --watch your_script.js
  • Node.js starts watching the specified file (or directory) for changes.
  • Whenever a change is detected, Node.js automatically restarts the script

Free resources to learn --watch

More in stage 10: Template Engines

--watch: common questions

Can I learn --watch in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain --watch in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this --watch tutorial for beginners?

It is lesson 75 of 113 in the free Node.js roadmap, in stage 10, Template Engines. If you are new to Node.js, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me