diff options
author | Aleksei Koziatinskii <ak239spb@gmail.com> | 2019-06-26 01:28:56 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-21 08:19:06 +0300 |
commit | f02dfdb2b5e266a057eda1e07eafc62b55f468d3 (patch) | |
tree | d1fc208e5dc31744f56ba566d0720ad52c6c35fd /doc/api/inspector.md | |
parent | b30dca8d9efcff9d7650e633c20c93ace5e52f36 (diff) |
inspector: add inspector.waitForDebugger()
This method blocks current node process until a client sends
Runtime.runifWaitingForDebugger.
It can be useful when we need to report inspector.url() before
waiting for connection:
```
inspector.open(0, undefined, false);
fs.writeFileSync(someFileName, inspector.url());
inspector.waitForDebugger();
```
PR-URL: https://github.com/nodejs/node/pull/28453
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api/inspector.md')
-rw-r--r-- | doc/api/inspector.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 63d2a702724..e2980a278d1 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -52,6 +52,16 @@ parameter usage. Return the URL of the active inspector, or `undefined` if there is none. +## inspector.waitForDebugger() +<!-- YAML +added: REPLACEME +--> + +Blocks until a client (existing or connected later) has sent +`Runtime.runIfWaitingForDebugger` command. + +An exception will be thrown if there is no active inspector. + ## Class: inspector.Session The `inspector.Session` is used for dispatching messages to the V8 inspector |