explaingit

googlechromelabs/ndb

10,899JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

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.

Mindmap

mindmap
  root((ndb))
    What it does
      Node.js debugging
      Chrome DevTools UI
      Child process attach
    Features
      Early breakpoints
      File editing
      Internal files hidden
    Tech Stack
      Node.js JavaScript
      Chromium
    Setup
      npm install
      170-280MB download
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Debug a Node.js server with a graphical Chrome DevTools interface instead of the text-based debugger

USE CASE 2

Set breakpoints in a Node.js app before startup to catch errors that happen during initialization

USE CASE 3

Debug programs that spawn child processes by having ndb auto-attach to them automatically

USE CASE 4

Edit Node.js source files directly in the DevTools panel and save them without restarting the process

Tech stack

JavaScriptNode.jsChromium

Getting it running

Difficulty · easy Time to first run · 5min

Downloads a 170-280MB copy of Chromium during npm install depending on your operating system.

In plain English

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.

Copy-paste prompts

Prompt 1
Using ndb, help me debug a Node.js Express server that crashes on startup, set up early breakpoints and trace the error to its source
Prompt 2
Show me how to use ndb to debug a Node.js script that spawns child processes with child_process.fork, and explain how ndb auto-attaches to those processes
Prompt 3
Help me replace node --inspect with ndb in my npm scripts so I get the full Chrome DevTools panel with Node.js internals hidden from view
Prompt 4
Using ndb, set up a debugging session for a Node.js worker pool that uses cluster.fork and inspect each worker memory usage in the DevTools profiler
Open on GitHub → Explain another repo

← googlechromelabs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.