Built-in Node.js inspector

suggest change

Node.js includes the V8 inspector. Start a script and pause before its first statement with:

node --inspect-brk filename.js

Use --inspect when the script should start immediately. Node.js prints a WebSocket inspector URL. Open chrome://inspect in Chrome or attach with a compatible editor.

The debugger statement creates a source breakpoint:

'use strict';

function addTwoNumbers(a, b) {
    debugger;
    return a + b;
}

const result = addTwoNumbers(5, 9);
console.log(result);
14

Do not expose the inspector port to untrusted networks. An attached debugger can execute code in the process.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents