Pessoas, segue esse plugin que mostra como fazer Debug do seu código JavaScript usando Node.
Como ainda não estamos codando e executando no browser para usar as ferramentas do Developer Tools do Chrome/Firefox ficamos apenas com o recurso do terminal apontar o erro na linha, segue o link de como fazer isso direto no Atom.
Abaixo segue a explicação:
node-debugger package
A simple Node.js/io.js debugger for daily use.
Usage
Open a javascript (.js) file and execute the start-resume command (F5) to launch the debugger.
Debug panels will show up as shown in the image below.
The '>' symbol in the gutter marks the current line of execution.
Execute the toggle-breakpoint (F9) command to set a breakpoint. The breakpoint will be displayed in the gutter using a red marker.
Execute start-resume (F5) again to resume debugging or use the step-next (F10), step-in (F11) or step-out (shift-F11) commands.
Commands
You may access the commands using CMD/Ctrl+p or by using the shortcut key specified within the brackets.
When executing the start-resume command the node-debugger will try to figure out
which file that is the main file of the current atom project.
This is the strategy being used:
use configured entry point (scriptMain)
attempt to read entry point from package.json in the project root folder
attempt to start currently open file (ctrl+F5 hot-key)
cannot start debugger
Attaching to external processes
Start your node application in debug mode using
>node --debug=5858 a.js
or
>node --debug-brk=5858 a.js
Make sure that your node-debugger settings for debugHost and debugPort are
matching what you are using. In the case above debugPort should be 5858.
Execute command node-debugger: attach either from the menu or using the command
panel.
Pessoas, segue esse plugin que mostra como fazer Debug do seu código JavaScript usando Node. Como ainda não estamos codando e executando no browser para usar as ferramentas do Developer Tools do Chrome/Firefox ficamos apenas com o recurso do terminal apontar o erro na linha, segue o link de como fazer isso direto no Atom.
Open a javascript (.js) file and execute the start-resume command (F5) to launch the debugger.
Debug panels will show up as shown in the image below.
The '>' symbol in the gutter marks the current line of execution.
Execute the toggle-breakpoint (F9) command to set a breakpoint. The breakpoint will be displayed in the gutter using a red marker.
Execute start-resume (F5) again to resume debugging or use the step-next (F10), step-in (F11) or step-out (shift-F11) commands.
Commands
You may access the commands using CMD/Ctrl+p or by using the shortcut key specified within the brackets.
Configuration
The following attributes can be set to control the node-debugger.
An example of a configuration is given below.
Debugging projects in atom
When executing the start-resume command the node-debugger will try to figure out which file that is the main file of the current atom project. This is the strategy being used:
Attaching to external processes
Start your node application in debug mode using
or
Make sure that your node-debugger settings for debugHost and debugPort are matching what you are using. In the case above debugPort should be 5858.
Execute command node-debugger: attach either from the menu or using the command panel.
[ ],s