From e8bef236d6a247e0d55b49f8b738e136c70100c6 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Benito Date: Sat, 3 May 2025 11:07:24 +0100 Subject: [PATCH 1/3] doc: clarify behavior of --watch-path and --watch flags --- doc/api/cli.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index 61a047e5ac159f..99f5244d68b7ed 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3056,6 +3056,10 @@ Use `--watch-path` to specify what paths to watch. This flag cannot be combined with `--check`, `--eval`, `--interactive`, or the REPL. +Note: The `--watch` flag requires a file path as an argument. It does not support +being used with `--run` or inline script input. If no file is provided, Node.js will +exit with status code 9. + ```bash node --watch index.js ``` @@ -3083,6 +3087,9 @@ combination with `--watch`. This flag cannot be combined with `--check`, `--eval`, `--interactive`, `--test`, or the REPL. +Note: Using `--watch-path` implicitly enables `--watch`, which requires a file path +and is incompatible with `--run`, as `--run` takes precedence and ignores watch mode. + ```bash node --watch-path=./src --watch-path=./tests index.js ``` From f6b87b78feff224cf9c621698d5d0b354ce06004 Mon Sep 17 00:00:00 2001 From: juanibe <39571376+juanibe@users.noreply.github.com> Date: Thu, 8 May 2025 17:13:01 +0100 Subject: [PATCH 2/3] Update doc/api/cli.md Co-authored-by: Tierney Cyren --- doc/api/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 99f5244d68b7ed..0b688a69612fee 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3058,7 +3058,7 @@ This flag cannot be combined with Note: The `--watch` flag requires a file path as an argument. It does not support being used with `--run` or inline script input. If no file is provided, Node.js will -exit with status code 9. +exit with status code `9`. ```bash node --watch index.js From b34c59ec78b7ba2eb10a6a6572cda6d42a8c335f Mon Sep 17 00:00:00 2001 From: Juan Ignacio Benito Date: Thu, 8 May 2025 22:10:55 +0100 Subject: [PATCH 3/3] doc: clarify context of --run incompatibility --- doc/api/cli.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 0b688a69612fee..d69480be4e7baa 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -3056,9 +3056,9 @@ Use `--watch-path` to specify what paths to watch. This flag cannot be combined with `--check`, `--eval`, `--interactive`, or the REPL. -Note: The `--watch` flag requires a file path as an argument. It does not support -being used with `--run` or inline script input. If no file is provided, Node.js will -exit with status code `9`. +Note: The `--watch` flag requires a file path as an argument and is incompatible +with `--run` or inline script input, as `--run` takes precedence and ignores watch +mode. If no file is provided, Node.js will exit with status code `9`. ```bash node --watch index.js