Skip to content

Commit ae95779

Browse files
committed
doc: clarify glob support on --watch-path
1 parent 9b35739 commit ae95779

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

doc/api/cli.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3417,14 +3417,19 @@ added:
34173417
- v18.11.0
34183418
- v16.19.0
34193419
changes:
3420+
- version:
3421+
- REPLACEME
3422+
pr-url: https://github.com/nodejs/node/pull/59478
3423+
description: support glob patterns in paths
34203424
- version:
34213425
- v22.0.0
34223426
- v20.13.0
34233427
pr-url: https://github.com/nodejs/node/pull/52074
34243428
description: Watch mode is now stable.
34253429
-->
34263430

3427-
Starts Node.js in watch mode and specifies what paths to watch.
3431+
Starts Node.js in watch mode and specifies what paths to watch (the paths could
3432+
include glob patterns,e.g., `--watch-path='**/*.js'`).
34283433
When in watch mode, changes in the watched paths cause the Node.js process to
34293434
restart.
34303435
This will turn off watching of required or imported modules, even when used in
@@ -3436,6 +3441,9 @@ This flag cannot be combined with
34363441
Note: Using `--watch-path` implicitly enables `--watch`, which requires a file path
34373442
and is incompatible with `--run`, as `--run` takes precedence and ignores watch mode.
34383443

3444+
When using `--watch-path` with glob patterns, you must include quotations `'<glob-pattern>'` to
3445+
ensure it does not get expanded by the shell interpreter
3446+
34393447
```bash
34403448
node --watch-path=./src --watch-path=./tests index.js
34413449
```

0 commit comments

Comments
 (0)