From f53ad670cb8cd1acfde82e0a34edb848c2fa0885 Mon Sep 17 00:00:00 2001 From: cola119 Date: Wed, 1 May 2024 18:45:10 +0900 Subject: [PATCH 1/3] inspector: introduce the `--inspect-wait` flag --- doc/api/cli.md | 10 ++++++++++ doc/api/debugger.md | 6 ++++-- doc/node.1 | 5 +++++ src/inspector_agent.cc | 20 +++++++++++-------- src/node_options.cc | 8 ++++++++ src/node_options.h | 6 ++++++ test/parallel/test-inspector-wait.mjs | 28 +++++++++++++++++++++++++++ 7 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 test/parallel/test-inspector-wait.mjs diff --git a/doc/api/cli.md b/doc/api/cli.md index dbfa6045567a77..f070a896cd84ba 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1284,6 +1284,15 @@ Specify ways of the inspector web socket url exposure. By default inspector websocket url is available in stderr and under `/json/list` endpoint on `http://host:port/json/list`. +### `--inspect-wait[=[host:]port]` + + + +Activate inspector on `host:port` and wait for debugger to be attached. +Default `host:port` is `127.0.0.1:9229`. + ### `-i`, `--interactive` @@ -1263,6 +1264,8 @@ added: v7.6.0 Activate inspector on `host:port` and break at start of user script. Default `host:port` is `127.0.0.1:9229`. +See [V8 Inspector integration for Node.js][] for further explanation on Node.js debugger. + ### `--inspect-port=[host:]port`