Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix structure and formatting in inspector.md #21709

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions doc/api/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ It can be accessed using:
const inspector = require('inspector');
```

## inspector.close()

Deactivate the inspector. Blocks until there are no active connections.

## inspector.console

* {Object} An object to send messages to the remote inspector console.

```js
require('inspector').console.log('a message');
```

The inspector console does not have API parity with Node.js
console.

## inspector.open([port[, host[, wait]]])

* `port` {number} Port to listen on for inspector connections. Optional.
Expand All @@ -28,22 +43,7 @@ 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.console

An object to send messages to the remote inspector console.

```js
require('inspector').console.log('a message');
```

The inspector console does not have API parity with Node.js
console.

### inspector.close()

Deactivate the inspector. Blocks until there are no active connections.

### inspector.url()
## inspector.url()

* Returns: {string|undefined}

Expand Down Expand Up @@ -112,6 +112,16 @@ Connects a session to the inspector back-end. An exception will be thrown
if there is already a connected session established either through the API or by
a front-end connected to the Inspector WebSocket port.

### session.disconnect()
<!-- YAML
added: v8.0.0
-->

Immediately close the session. All pending message callbacks will be called
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.post(method[, params][, callback])
<!-- YAML
added: v8.0.0
Expand Down Expand Up @@ -139,16 +149,6 @@ by V8. Chrome DevTools Protocol domain provides an interface for interacting
with one of the runtime agents used to inspect the application state and listen
to the run-time events.

### session.disconnect()
<!-- YAML
added: v8.0.0
-->

Immediately close the session. All pending message callbacks will be called
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.

## Example usage

### CPU Profiler
Expand Down