Node.js has built-in debugging tools and supports the inspector protocol.
Getting Started
What is Node.js?
Modules & NPM
Modules & NPM
Process & Environment
Process & Environment Variables
Caching & Performance
Redis Caching
GraphQL with Node.js
GraphQL Basics
Node.js
Intermediate
FREE
Debugging with Node
Lesson 2 of 17
Intermediate
Interactive
Syntax
NODEJS
node --inspect app.js
node --inspect-brk app.js
debugger; // breakpoints in code
Node.js Debugging
NODE
const debug = require("debug")("app:server"); function processData(items) { debug("Processing %d items", items.length); const result = items.map(item => { debug("Processing item: %o", item); return item * 2; }); debug("Result: %o", result); return result; } processData([1, 2, 3, 4, 5]); // Console methods console.log("Log message"); console.warn("Warning"); console.error("Error"); console.time("timer"); console.timeEnd("timer");