homerchen19/nba-go

How to debug application <Help Wanted>

tommymathan opened this issue · 2 comments

Hey does anyone know how I could go about debugging this application, I come from a C# background, and I wanted to kind of learn more about node.js and I think this application would be a great application to step through and debug, so I was wondering , how would I do that through something like vscode?

Setting up basic breakpoints is easy. Just write the line
debugger;
where you want the break point. Then when you run the program use node inspect, for an example run this from your command line in the nba-go folder:
NODE_ENV=development node inspect bin/cli.js player -r "lebron james"

Then you can use "c" to continue till the next breakpoint and then you can type "repl" after reaching a breakpoint and then you can access all the variables.

I am in the same situation as OP, want to to try to work on some of the open issues to get experience with node.js, but I am having some trouble understanding the flow of the program. I see cli.js is the first thing that runs, but I am confused on what happens next. Is there some sort of guide for this kind of program or something else that may help with understanding it?
Thanks in advance for any help.