Launch
And attach the difference
Launch is then directly after running a js file in debug mode, met debugger will stop
and
Attach need to open a run to open the debug port project in debug mode nodejs
data:
https://code.visualstudio.com/docs/nodejs/nodejs-debugging
How Debugger works:
You have called the system call ptrace, a process that can be used to monitor the execution of another process control, and even made him pause. Gets the call stack execution of another process .. then we can construct a debugger.
https://www.cnblogs.com/moonz-wu/archive/2012/01/15/2322120.html
https://i5ting.github.io/node-debug-tutorial/
https://stackoverflow.com/questions/42563900/how-does-the-visual-studio-attach-to-process-work
According nodejs document describes,
1.Nodejs comes with a simple debugger client
Use node inspect xxx.js start debugging
2. If you want to use more full-featured debugger client's
-Inspect need to use markers to open the V8 inspector,
Then we can achieve a debugger and a client to interact with Chrome DevTools Protocol
(For example, attach the debug mode VsCode)
data:
https://nodejs.org/en/docs/guides/debugging-getting-started/