Skip to content
This repository was archived by the owner on Jul 31, 2018. It is now read-only.

Commit 2ea0398

Browse files
author
Jan Krems
committed
proposal: node inspect CLI debugger
1 parent f16f770 commit 2ea0398

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

XXX-node-inspect-cli-debugger.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
| Title | `node inspect` CLI debugger |
2+
|--------|-----------------------------|
3+
| Author | @jkrems |
4+
| Status | DRAFT |
5+
| Date | 2016-09-04 |
6+
7+
## Description
8+
9+
For the old V8 debugger protocol,
10+
node offers two ways to use it:
11+
12+
1. `node --debug <file>`: Start `file` with remote debugging enabled.
13+
2. `node debug <file>`: Start an interactive CLI debugger for `<file>`.
14+
15+
But for the Chrome inspector protol,
16+
there's only one (`--inspect`) which is roughly equivalent to the `--debug` flag.
17+
It's impossible to use the new protocol without an external tool.
18+
19+
This proposes the addition of the following commands to node:
20+
21+
```
22+
node inspect script.js # Start interactive debug session for script.js
23+
node inspect <host>:<port> # Connect to inspector protocol on host:port
24+
```
25+
26+
The `kill -USR2` options (`node inspect -p <pid>`) would be harder to implement.
27+
So while it might be very useful long-term,
28+
this proposal explicitly does not include this variant.
29+
30+
The debug repl should offer the same methods & similar output to the [current debugger](https://nodejs.org/api/debugger.html).
31+
32+
## Alternatives
33+
34+
* Offer a blessed, stand-alone `node-inspect` module that can be installed via npm.
35+
* The methods & output could follow `gdb`'s example instead since it's being re-implemented anyhow.
36+
* The methods & output could follow `lldb`'s example instead since it's being re-implemented anyhow.

0 commit comments

Comments
 (0)