4

Appreciate inputs to debug easily and effectively an already installed third party node module (say mkdirp or expressjs ...)

I looked at node-inspector but looks like it can debug only direct scripts (like node-debug myscript.js).

But for my case, I want to debug the installed module directly when i use it in the terminal. For example, when i run the browserify in the terminal using browserify main.js -o bundle.js, i want to start debugging the browserify module code.

Currently placing console.log statements in the third party code which is very painful.

1 Answer 1

1

Obviously an older question, but for anyone else who stumbles across this question, you can debug just by getting node to launch the module directly, so I think you could do something like:

node-debug node_modules/browersify/bin/browserify main.js -o bundle.js

I was personally using vscode trying to debug tslint, and there I created a debug configuration like this:

{
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceFolder}\\node_modules\\tslint\\bin\\tslint",
      "args": [
        "-c",
        "tslint.json",
        "-p",
        "tsconfig.json"
      ]
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.