13

I use Firefox for my daily browsing; so the process of getting a Node inspector running is somewhat annoying:

  1. Launch Chrome.
  2. Manually visit chrome://inspect, because it refuses to set a builtin page as the ‘homepage’.
  3. Click “Open dedicated DevTools for Node.”
  4. Close the original window after the Node devtools opens.

This dedicated tools window is the only Chrome window I ever use. Is there any way to launch it from the command-line, or when Chrome opens?

Giacomo1968
  • 58,727
ELLIOTTCABLE
  • 2,708

3 Answers3

3

Have Chrome's homepage set to this: chrome-devtools://devtools/bundled/node_app.html

When Chrome opens, the dedicated node Devtools will automatically be opened, but not as a pop-up.

Ultrasonic54321
  • 657
  • 4
  • 13
0

To add to Ultrasonic54321's answer. The prefix was changed from chrome-devtools to devtools only. See https://github.com/ChromeDevTools/devtools-protocol/issues/224

But playing around a bit with it, it does behave differently than the one open manually through the inspector.

Giacomo1968
  • 58,727
matjaz
  • 1
0

See the release note: https://github.com/sandipchitale/node-debugger/releases/tag/v0.1

It uses java.awt.Robot to launch Chrome and drive to the dedicated devtools for node page.

  • Extract the .zip

  • Run the command

  • Linux/Mac:

    cd launch-node-debugger
    bin/launch-node-debugger
    
  • Windows:

    cd launch-node-debugger
    bin\launch-node-debugger.bat
    

You may add the bin folder to PATH environment variable.

You can add it as a pre script in package.json like this:

{
  "scripts": {
    "prestart": "launch-node-debugger",
    "start": "node --inspect-brk index.js"
  },
}
Giacomo1968
  • 58,727