Skip to content

Commit 549bae4

Browse files
committed
docs: added docs for --watch-pattern
1 parent 3dd9c46 commit 549bae4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

doc/api/cli.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,22 @@ This option is only supported on macOS and Windows.
32333233
An `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` exception will be thrown
32343234
when the option is used on a platform that does not support it.
32353235

3236+
### `--watch-pattern`
3237+
3238+
<!-- YAML
3239+
added: REPLACEME
3240+
-->
3241+
3242+
> Stability: 1.0 - Early development
3243+
3244+
This is similar to `--watch-path` option, which starts Node.js in
3245+
watch mode and is used to specify which paths to watch using globs.
3246+
Additionally, this option supports watching files and directories.
3247+
3248+
```bash
3249+
node --watch-pattern=./**/*.js index.js
3250+
```
3251+
32363252
### `--watch-preserve-output`
32373253

32383254
<!-- YAML

doc/node.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,9 @@ By default, watch mode will watch the entry point and any required or imported m
649649
.It Fl -watch-path
650650
Starts Node.js in watch mode and specifies what paths to watch. When in watch mode, changes in the watched paths cause the Node.js process to restart.
651651

652+
.It Fl -watch-pattern
653+
Starts Node.js in watch mode and can include glob patterns when specifying what paths to watch. When in watch mode, changes in the watched paths cause the Node.js process to restart.
654+
652655
This will turn off watching of required or imported modules, even when used in combination with --watch.
653656
.
654657
.It Fl -watch-kill-signal

0 commit comments

Comments
 (0)