Tuesday, 4 April 2017

Debugging NodeJs application in windows


Basic debugging

1. execute cmd.exe or open command line
2, type  "node debug [path]/[file name].js". you can see that as below.




3. type "n", it will go to next step.


4. type "c". It will continue to run the rest code without stop. 

5. type "quit". it will leave debug. 


Advance debug
1.  How to watch on break point. 
     1.1 type  "node debug [path]/debuugering.js".
     1.2 type "n"
     1.3 type "n"
     1.4 type "repl"
     1.5 type "console.log(person.age)"
  You can see the value of current person.age. 












2. Set up a break point in js file. 
    2.1 open debugging.js file 
    2.2 type "debugger"
    2.3 save the file
    2.4 go back to command line. 
    2.5 type  "node debug [path]/debuugering.js".
    2.6 type "c"
    2.7 it will run until break point. 



No comments:

Post a Comment

how-to-recursively-create-subfolder-in-each-folder-of-a-directory-in-cmd

test.cmd: @echo off setlocal for /f "usebackq tokens=*" %%a in (`dir /b /a:d`) do ( rem enter the directory pushd %%a echo...