DELAPARRA
Index
Color
NL
Category: CLI flags

-w, --watch (Watch)

Explained by Updated

What is -w, --watch (Watch)?

-w, --watch (Watch): Keep the command running and re-run it (or refresh output) whenever the input changes. Watch mode keeps a command running and repeats its work whenever something changes. npm run dev with Vite rebuilds your assets when you save a file. jest --watch reruns the tests that relate to your change. kubectl get pods -w keeps printing as pods start and stop.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about -w, --watch (Watch)

How is -w, --watch (Watch) used in practice?

The point is a short feedback loop. You save, and a second later you see whether it worked. That keeps you in the flow instead of switching to a terminal every few minutes.

What should you keep in mind with -w, --watch (Watch)?

Watchers use file system events, and those have limits. Very large projects can hit the operating system's limit on watched files, and some setups with Docker or network drives miss changes completely. If a watcher seems to ignore your edits, that is usually the cause. Restarting it is a quick check; raising the watch limit or using polling is the longer fix.

At a glance

CategoryCLI flags
Explained by
Updated

More CLI flags terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.