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

Commit

Permalink
proposal: node inspect CLI debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Krems committed Sep 4, 2016
1 parent f16f770 commit 2ea0398
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions XXX-node-inspect-cli-debugger.md
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.

0 comments on commit 2ea0398

Please sign in to comment.