-3

I am noob in nodejs. I wonder is it possible to debug javascript(referenced to javascript file) within an html file with nodejs ?. I mean that we can execute functions, querying some variables etc, just like we testing / debugging in developer console on browser.

if I test only the javascript file,it gives some errors because it referenced some of document objects like NodeList, window etc.

broid
  • 117
  • 1
  • 9

1 Answers1

0

I don' really understand your question, "debug javascript within an html file with nodejs".

But if you want something similar to the developer console on the browser, you can have exactely the same for nodejs. It is called node-inspector and can be found here: https://www.npmjs.com/package/node-inspector basically after install node-inspector npm install node-inspector -g you can run your app with the following command node-debug app.js and basically it will open you in chrome pointing at the port 8080 and you will have the inspector there, you can set breakpoints, pause, watch variables and everything.

I hope it is what you need

DevAlien
  • 2,252
  • 13
  • 16