gitmyhub

ndb

JavaScript ★ 11k updated 4y ago ▣ archived

ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools

ndb is a Node.js debugger from Google Chrome Labs that opens the Chrome DevTools interface for your programs, with extras like auto-attach to child processes and the ability to set breakpoints before any code loads.

JavaScriptNode.jsChromiumsetup: easycomplexity 2/5

ndb is a debugging tool for Node.js created by the Google Chrome Labs team. Node.js is software that lets you run JavaScript code outside a web browser, typically to build servers or command-line tools. Debugging is the process of stepping through your code to find and understand problems, usually by pausing execution at specific lines, inspecting variable values, and watching how data changes as the program runs.

The tool works by opening the Chrome DevTools interface (the same panel you get when you press F12 in a Chrome browser) and connecting it to your Node.js program. This gives you a familiar, graphical debugging environment instead of the simpler text-based debugger that comes with Node.js by default. You use it by typing "ndb" in front of any command you would normally run, so "node server.js" becomes "ndb server.js", and the DevTools panel opens automatically.

A few things make ndb more useful than standard Node.js debugging. It detects child processes automatically and attaches to them, which matters for programs that spawn other programs. It lets you set breakpoints before any code has even been loaded, which is useful when you need to catch problems that happen at startup. It also hides the internal Node.js files from the debugger view by default, so you are only shown your own code rather than the plumbing underneath. You can edit files directly in the interface and save them to disk.

Installation is through npm, the standard Node.js package manager. The tool downloads a copy of Chromium (the open-source browser behind Chrome) as part of setup, which adds around 170 to 280 megabytes depending on your operating system. It requires Node.js version 8 or higher and works best on version 10 or higher. The repository is from 2018 and the README does not indicate ongoing active maintenance.

Where it fits