How can I debug node modules?

I have been engaging in a pretty exciting node.js, but I'm trying to find ways to replace the current development environment.

Currently, my best friend in PHPLand is the FirePHP module for Firebug, which is sending god since your PHP is debugging. What methods do I have for debugging node code? Does it display errors and warnings, such as PHP, can be set to?

+6
source share
1 answer

There are several ways to debug a node.

Personally, I use the many useful provisions of console.log , console.dir and util.inspect in my code and follow the logic in this way.

Of course, unit tests go hand in hand with debugging. Write tests to prove your code is working. Unit tests will cover most errors.

You must write unit tests for your node.js code. nodeunit great for general testing.

If you use express as your web engine, use expresso

+5
source

Source: https://habr.com/ru/post/890482/


All Articles