Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@custody/plugin-command-start-debugger

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@custody/plugin-command-start-debugger

Custody plugin to add a command to start the Node debugger

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

custody-plugin-command-start-debugger

Users can start the Node debugger by starting a process with the inspect argument or --inspect flag. However, if your process is run under a process monitor like Supervisor or even just nodemon, you can't easily alter its arguments nor flags.

Luckily, Node lets you direct a running process to start the debugger by signalling the process with 'SIGUSR1'. However this method requires you to identify the process ID, which means reading it out of your process monitor's logs, if it's logged at all. Also, Node will always start the debugger on the same port, which prevents you from debugging multiple processes simultaneously.

And when you make a change to the process, you have to go through this rigamarole all over again.

This custody plugin fixes all that:

  • it lets you launch the debugger for a given process with a single keypress
  • it directs Node to find an open port for the inspector
  • it tracks when a process that is being debugged restarts and reattaches the debugger after the process finishes restarting

Installation

npm install -g @custody/plugin-command-start-debugger

Then launch custody-cli settings and add "@custody/plugin-command-start-debugger" to your .custodyrc.

This module requires that you instrument every process you wish to debug with @custody/probe, please configure that before proceeding. See here for why.

Usage

After opening a process' details in custody

press 'd' to launch Chrome DevTools. If you wish to assign a different key, for instance "w", edit the "@custody/plugin-command-start-debugger" line in your .custodyrc to look like the following:

{
  "plugins": [
    ["@custody/plugin-command-start-debugger", {
      "key": "w"
    }]
  ]
}

DevTools will open in a new Chromium instance due to limitations of Chrome's automation.

If the process restarts, DevTools will briefly disconnect and then reconnect when the process finishes restarting.

To stop debugging, simply close the DevTools tab in Chromium and/or Chromium itself.

Contributing

We welcome bug reports and feature suggestions!

Keywords

FAQs

Package last updated on 25 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc