1. License
“including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”
MIT allows use in paid and closed-source products.
github.com/debug-js/debug/blob/master/LICENSE3. Used by agents' projects
Dependency in 18 public GitHub projects set up for AI coding agents that we scanned (0.3%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What debug does
debug is a free JavaScript package for messages that stay silent until you ask for them. Each part of your app gets a name, and you switch on only the parts you want to watch, in Node.js or in the browser. Each line also shows how much time passed since the previous one.
What people build with it
Watch one part of your app
Payments misbehave; you switch on only the payment and cart messages and leave the noisy database messages off.
Quiet by default, detail on demand
Leave the messages in your code for good; they print nothing until someone starts the app with DEBUG set.
Find the slow step
Put a message before and after a slow request; the +340ms at the end of the line shows where the time went.
Debug a page in the browser
Turn on the messages of one part of your web app in the browser, then reload the page to see them in the console.
Group messages under sub-names
One area of your app, such as sign-in, gets sub-names for each step, so you can watch all of them or just one.
Let your assistant rerun with details Idea
When a command fails, your AI assistant reruns it with DEBUG set for one area and reads the extra lines, without editing code.
debug popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How debug is used
- debug is a dependency in 18 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 87 projects, and what it is used with below comes from all of them.
- The most used alternative in our scan is Pino (87 projects).
- Projects that use it most often also use dotenv (54.0%), ws (33.3%), Express (33.3%).
By coding agent
Often used with
More about debug
Agent Skills for it
- debug: Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction
- debug-voice: Use when the user runs /debug-voice, says voice mode has flaws, asks to see or capture what happened in a Grok realtime voice session, or a
- debug-resend-delivery: Find out why an email sent with Resend did not arrive — find the email, read its status, then check the API log, the suppression list, the s
- debug-tool: Diagnose runtime and application failures.
- debug-hooks: Systematic hook debugging workflow. Use when hooks aren't firing, producing wrong output, or behaving unexpectedly.
- debug-mantra: Four-mantra debugging discipline — reproduce, trace the fail path, falsify the hypothesis, cross-reference every breadcrumb. Recite the mant
More in Logging, monitoring and analytics
Alternatives
debug This page
Pick pino when you need permanent, structured app logs with levels that a log service can read, not on-demand debug lines.
Pick winston when logs must go to several places at once, such as the console and files, with log levels.
Pick Loguru when your program is written in Python.
Error tracking and performance monitoring for Node.js with OpenTelemetry instrumentation.
Official Sentry SDK for React error tracking and performance monitoring.
Get started
Tell your AI assistant
“Add debug 4.4.3 (pin it exactly, never 4.4.2) and give each module a named logger like require('debug')('app:payments'); keep the calls in the code, and tell me to run with DEBUG=app:* to see them.”
Create a named logger and write messages with it.
var debug = require('debug')('http') , http = require('http') , name = 'My App'; // fake app debug('booting %o', name);Switch the names on when you start the program. A star matches many names, and a minus sign leaves one out.
DEBUG=connect:* node app.js
Mistakes to avoid
4.4.2 was pushed to the registry by an attacker; 4.4.3 is the clean replacement.
enable() replaces the earlier setting completely.
debug writes to stderr by default.
Chromium consoles hide debug's messages unless Verbose is on.
debug turns colors off when stderr is not a terminal.
Questions
Why do I see nothing in Chrome's console?
Chromium browsers show debug's messages only when the console's Verbose level is turned on, and the names must be enabled in localStorage.debug.
How do I switch it on in Windows?
In cmd use set DEBUG=*,-not_this; in PowerShell use $env:DEBUG = "*,-not_this", then start the program as usual.
Can I switch names on from code?
Yes, with enable(). It replaces whatever DEBUG was set to, and disable() switches everything off.
Why are the colors missing in a child process?
Colors are dropped when the error output is piped. Pass DEBUG_COLORS=1 to the child process.