Skip to content

Commit

Permalink
Merge Debugging Guide and Inspector Help (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhemberger authored Apr 2, 2018
1 parent 38e407d commit a0d5211
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 121 deletions.
19 changes: 17 additions & 2 deletions locale/en/docs/guides/debugging-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ info on these follows:
* **Option 3**: Install the Chrome Extension NIM (Node Inspector Manager):
https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

#### [VS Code](https://github.com/microsoft/vscode) 1.10+
#### [Visual Studio Code](https://github.com/microsoft/vscode) 1.10+

* In the Debug panel, click the settings icon to open `.vscode/launch.json`.
Select "Node.js" for initial setup.

#### [Visual Studio](https://github.com/Microsoft/nodejstools) 2017

* Choose "Debug > Start Debugging" from the menu or hit F5.
* [Detailed instructions](https://github.com/Microsoft/nodejstools/wiki/Debugging).

#### [JetBrains WebStorm](https://www.jetbrains.com/webstorm/) 2017.1+ and other JetBrains IDEs

* Create a new Node.js debug configuration and hit Debug. `--inspect` will be used
Expand All @@ -91,7 +96,7 @@ info on these follows:

The following table lists the impact of various runtime flags on debugging:

<table cellpadding=0 cellspacing=0>
<table cellpadding="0" cellspacing="0">
<tr><th>Flag</th><th>Meaning</th></tr>
<tr>
<td>--inspect</td>
Expand Down Expand Up @@ -142,6 +147,16 @@ The following table lists the impact of various runtime flags on debugging:
</ul>
</td>
</tr>
<tr>
<td><code>node inspect --port=xxxx <i>script.js</i></code></td>
<td>
<ul>
<li>Spawn child process to run user's script under --inspect flag;
and use main process to run CLI debugger.</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
</ul>
</td>
</tr>
</table>

---
Expand Down
116 changes: 1 addition & 115 deletions locale/en/docs/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,118 +5,4 @@ layout: docs.hbs

# Debugging Node.js Apps

Many tools and libraries are available to help you debug your Node.js apps. Some
of these are listed below.

To connect manually rather than with a tool, pass the **--inspect** flag and
connect to the printed URL.

If a process was started without `--inspect`, signal it with SIGUSR1 to
activate the debugger and print the connection URL.

---

## Inspector Tools & Clients

These commercial and open source tools make debugging Node.js apps easier.

### [node-inspect](https://github.com/nodejs/node-inspect)

* A CLI debugger developed at <https://github.com/nodejs/node-inspect>.
* Bundled with Node and invoked with `node inspect myscript.js`.
* Can also be installed independently with `npm install -g node-inspect`
and invoked with `node-inspect myscript.js`.

### [Chrome DevTools](https://github.com/ChromeDevTools/devtools-frontend)

* **Option 1**: Open `chrome://inspect` in a Chromium-based
browser. Click the "Open dedicated DevTools for Node" link.
* **Option 2**: Install the Chrome Extension NIM (Node Inspector Manager):
https://chrome.google.com/webstore/detail/nim-node-inspector-manage/gnhhdgbaldcilmgcpfddgdbkhjohddkj

### [VS Code](https://github.com/microsoft/vscode) 1.10+

* In the Debug panel, click the settings icon to open `.vscode/launch.json`.
Select "Node.js" for initial setup.

### [Visual Studio](https://github.com/Microsoft/nodejstools)

* Choose "Debug > Start Debugging" from the menu or hit F5.
* [Detailed instructions](https://github.com/Microsoft/nodejstools/wiki/Debugging).

### [JetBrains WebStorm](https://www.jetbrains.com/webstorm/) 2017.1+ and other JetBrains IDEs

* Create a new Node.js debug configuration and hit Debug.

### [chrome-remote-interface](https://github.com/cyrus-and/chrome-remote-interface)

* Library to ease connections to Inspector Protocol endpoints.

---

## Command-line options

The following table lists the impact of various runtime flags on debugging:

<table cellpadding=0 cellspacing=0>
<tr><th>Flag</th><th>Meaning</th></tr>
<tr>
<td>--inspect</td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Listen on default address and port (127.0.0.1:9229)</li>
</ul>
</td>
</tr>
<tr>
<td>--inspect=<i>[host:port]</i></td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Bind to address or hostname <i>host</i> (default: 127.0.0.1)</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
</ul>
</td>
</tr>
<tr>
<td>--inspect-brk</td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Listen on default address and port (127.0.0.1:9229)</li>
<li>Break before user code starts</li>
</ul>
</td>
</tr>
<tr>
<td>--inspect-brk=<i>[host:port]</i></td>
<td>
<ul>
<li>Enable inspector agent</li>
<li>Bind to address or hostname <i>host</i> (default: 127.0.0.1)</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
<li>Break before user code starts</li>
</ul>
</td>
</tr>
<tr>
<td><code>node inspect <i>script.js</i></code></td>
<td>
<ul>
<li>Spawn child process to run user's script under --inspect flag;
and use main process to run CLI debugger.</li>
</ul>
</td>
</tr>
<tr>
<td><code>node inspect --port=xxxx <i>script.js</i></code></td>
<td>
<ul>
<li>Spawn child process to run user's script under --inspect flag;
and use main process to run CLI debugger.</li>
<li>Listen on port <i>port</i> (default: 9229)</li>
</ul>
</td>
</tr>
</table>
Page has been moved to [Guides: Debugging - Getting Started](./guides/debugging-getting-started/).
4 changes: 0 additions & 4 deletions locale/en/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@
"link": "docs/es6",
"text": "ES6 and beyond"
},
"inspector": {
"link": "docs/inspector",
"text": "Inspector"
},
"api-lts": {
"link": "/dist/latest-%ver-major%/docs/api",
"subtext": "LTS",
Expand Down

0 comments on commit a0d5211

Please sign in to comment.