Monday, 22 October 2018

javascript - How do I debug Node.js applications?



How do I debug a Node.js server application?



Right now I'm mostly using alert debugging with print statements like this:



sys.puts(sys.inspect(someVariable));



There must be a better way to debug. I know that Google Chrome has a command-line debugger. Is this debugger available for Node.js as well?


Answer



The V8 debugger released as part of the Google Chrome Developer Tools can be used to debug Node.js scripts. A detailed explanation of how this works can be found in the Node.js GitHub wiki.


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...