3 ms·
is there something like this for node? sorry if this is an obvious q; i'm relatively new
by snapdeus 5y ago
is there something like this for node? sorry if this is an obvious q; i'm relatively new
- gavinray 5y agoSuper offtopic question, but I'll give you two answers: The literal one, and the one I know you're asking for. 1. The literal answer is yes. Node uses V8 as the execution engine. V8 uses something called "TurboFan" as one of the compiler + IR passes: https://v8.dev/docs/turbofan https://v8.dev/blog/turbofan-jit There's a tool that displays input JS code, and then visualizes the TurboFan IR node output. It's called Turbolizer. That would likely be the closest equivalent: https://github.com/v8/v8/tree/main/tools/turbolizer 2. The answer you want is you can just use a regular Node.js debugger and attach it to whatever it is you want to look at. The scope context will show all of this info. For things like "unused variables", etc, the TypeScript-for-JavaScript integration that I think is turned on by default in VS Code should catch this. So should Webstorm. So should any linting tool, like ESLint. At least I think this is what you're asking. Hope that helps.