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

Commit cb546c2

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

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

XXX-node-inspect-cli-debugger.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 `--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+
`node inspect -p <pid>` would be a lot harder to implement than the others.
27+
So while it might be very useful long-term,
28+
this proposal explicitly does not include that variant.
29+
30+
The debug repl should offer the same methods & similar output to the
31+
[current debugger](https://nodejs.org/api/debugger.html).
32+
33+
## Alternatives
34+
35+
* Offer a blessed, stand-alone `node-inspect` tool installed via npm.
36+
* The methods & output could follow `gdb`'s example.
37+
* The methods & output could follow `lldb`'s example.

0 commit comments

Comments
 (0)