This repository has been archived by the owner on Jul 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Krems
committed
Sep 4, 2016
1 parent
f16f770
commit 2ea0398
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
| Title | `node inspect` CLI debugger | | ||
|--------|-----------------------------| | ||
| Author | @jkrems | | ||
| Status | DRAFT | | ||
| Date | 2016-09-04 | | ||
|
||
## Description | ||
|
||
For the old V8 debugger protocol, | ||
node offers two ways to use it: | ||
|
||
1. `node --debug <file>`: Start `file` with remote debugging enabled. | ||
2. `node debug <file>`: Start an interactive CLI debugger for `<file>`. | ||
|
||
But for the Chrome inspector protol, | ||
there's only one (`--inspect`) which is roughly equivalent to the `--debug` flag. | ||
It's impossible to use the new protocol without an external tool. | ||
|
||
This proposes the addition of the following commands to node: | ||
|
||
``` | ||
node inspect script.js # Start interactive debug session for script.js | ||
node inspect <host>:<port> # Connect to inspector protocol on host:port | ||
``` | ||
|
||
The `kill -USR2` options (`node inspect -p <pid>`) would be harder to implement. | ||
So while it might be very useful long-term, | ||
this proposal explicitly does not include this variant. | ||
|
||
The debug repl should offer the same methods & similar output to the [current debugger](https://nodejs.org/api/debugger.html). | ||
|
||
## Alternatives | ||
|
||
* Offer a blessed, stand-alone `node-inspect` module that can be installed via npm. | ||
* The methods & output could follow `gdb`'s example instead since it's being re-implemented anyhow. | ||
* The methods & output could follow `lldb`'s example instead since it's being re-implemented anyhow. |