summaryrefslogtreecommitdiff
path: root/doc/api/inspector.md
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2017-05-25 19:00:24 -0700
committerSam Roberts <vieuxtech@gmail.com>2017-06-06 14:41:17 -0700
commit2791b360c11324f7c9ed83350f264c500ade4fe8 (patch)
tree32c398bc37f0d864d294cc629167aa577c30f08c /doc/api/inspector.md
parentdcfbbacba8c22613b956c1a3b9d958676e5d5e87 (diff)
downloadandroid-node-v8-2791b360c11324f7c9ed83350f264c500ade4fe8.tar.gz
android-node-v8-2791b360c11324f7c9ed83350f264c500ade4fe8.tar.bz2
android-node-v8-2791b360c11324f7c9ed83350f264c500ade4fe8.zip
inspector: allow --inspect=host:port from js
PR-URL: https://github.com/nodejs/node/pull/13228 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/inspector.md')
-rw-r--r--doc/api/inspector.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/api/inspector.md b/doc/api/inspector.md
index 73c735efd3..3336874b94 100644
--- a/doc/api/inspector.md
+++ b/doc/api/inspector.md
@@ -10,6 +10,30 @@ It can be accessed using:
const inspector = require('inspector');
```
+## inspector.open([port[, host[, wait]]])
+
+* port {number} Port to listen on for inspector connections. Optional,
+ defaults to what was specified on the CLI.
+* host {string} Host to listen on for inspector connections. Optional,
+ defaults to what was specified on the CLI.
+* wait {boolean} Block until a client has connected. Optional, defaults
+ to false.
+
+Activate inspector on host and port. Equivalent to `node
+--inspect=[[host:]port]`, but can be done programatically after node has
+started.
+
+If wait is `true`, will block until a client has connected to the inspect port
+and flow control has been passed to the debugger client.
+
+### inspector.close()
+
+Deactivate the inspector. Blocks until there are no active connections.
+
+### inspector.url()
+
+Return the URL of the active inspector, or `undefined` if there is none.
+
## Class: inspector.Session
The `inspector.Session` is used for dispatching messages to the V8 inspector
@@ -110,6 +134,7 @@ with an error. [`session.connect()`] will need to be called to be able to send
messages again. Reconnected session will lose all inspector state, such as
enabled agents or configured breakpoints.
+
[`session.connect()`]: #sessionconnect
[`Debugger.paused`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger/#event-paused
[`EventEmitter`]: events.html#events_class_eventemitter