debug
Keep, but not for new work. 7th of 9 logging libraries.
debug is a tiny utility that prints namespaced debug messages, switched on with the DEBUG variable. It has no levels, no structured output and no transports, so it is not a full app logger. For library authors it is still the standard way to add opt-in diagnostics. For app logging today, pick Pino or another leveled logger.
Best for: Library and tool authors who want opt-in, namespaced diagnostic output that costs nothing when it is off.
Scores
Overall4.5
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 4.5, likely 3.5 to 5.5
As a logging library for a new app, it misses the category's core needs: levels and structured output. Its maintenance has nearly stopped, and its recent supply-chain incident is a concern. Pino, and for some teams LogTape or winston, does the job better for most people. It remains a fine choice for opt-in diagnostics inside libraries.
- peers Pino: 82 commits a year and a 5.1x download ratio, against 3 commits and 2.3x for debug.
- betterstack.com/community/comparisons/pino-vs-winston: Production logging guides recommend Pino or winston.
- sonatype.com/blog/npm-chalk-and-debug-packages-hit-in-software-supply-chain-attack: debug was compromised in the September 2025 attack.
GPT-6.2 Sol: 4.4, likely 3.5 to 5.4
debug is worth choosing when selective diagnostics are the main requirement. For a new Node.js application logger, Pino covers severity levels and structured output and has a more active release history. The gap in logging features is clear, while the strength of the recommendation depends on how much the project values opt-in diagnostics.
- expressjs.com/en/5x/guide/debugging: Shows a practical workflow for selective diagnostics.
- fastify.dev/docs/latest/Reference/Logging: Documents Pino's application logging features in Fastify.
- github.com/debug-js/debug/issues/1064: The maintainer describes stable maintenance with no scheduled major update.
- github.releasesLastYear and peers.Pino.latestPublishedAt: debug had no release in the past year, while Pino published in October 2026.
Needed by many5.3
How many developers need a tool for this job?
Claude Opus 5.5: 5.0, likely 4.0 to 7.0
Almost every Node project installs debug through its dependencies, but few apps need it as their logger. It does only part of the category's job: namespaced debug output, with no levels or structure. Its main audience is library authors and developers who switch on diagnostics during development.
- npm-compare.com/@datadog/browser-logs,bunyan,debug,js-logger,log4js,loglevel,pino,winston: Describes debug as a diagnostic tool that complements a structured logger rather than replacing it.
- dependents.packages: 46,672 packages depend on it, which shows heavy use by library authors.
GPT-6.2 Sol: 5.6, likely 4.5 to 6.8
Opt-in diagnostics are useful across web apps, libraries, and developer tools, and debug supports both Node.js and browsers. Its focus on namespace-filtered messages limits its role in applications that need structured logs. Runtime surveys show how broadly it can run, while demand for this particular workflow is harder to measure.
- github.com/debug-js/debug/blob/4.4.3/README.md: Documents namespace filters and Node.js and browser support.
- 2025.stateofjs.com/en-US/other-tools/#runtimes: Node.js and browsers lead the survey's runtime usage results.
Helps a lot4.1
How well does it do the job for those who need it?
Claude Opus 5.5: 4.0, likely 3.0 to 5.0
It does its narrow job well. Namespaces, colors, time diffs, printf formatters, and it runs in both Node and browsers. Measured against the category's job, it lacks levels, structured output, transports and redaction, which Pino and winston provide. It also ships no bundled types.
- npm-compare.com/@datadog/browser-logs,bunyan,debug,js-logger,log4js,loglevel,pino,winston: No severity levels, no structured records, no transports.
- betterstack.com/community/comparisons/pino-vs-winston: Pino and winston cover production logging needs that debug does not.
- npm hasTypes: No bundled TypeScript types.
GPT-6.2 Sol: 4.2, likely 3.6 to 5.2
Version 4.4.3 has a small, well-documented API for namespace filters, object inspection, and timing. Its native output is formatted text, so structured records and severity thresholds take extra code. A benchmark run by another logger's author measured low overhead for disabled calls with cheap arguments, though that test covers only one part of the job.
- github.com/debug-js/debug/blob/4.4.3/README.md: Shows printf-style formatting, namespace filters, and output overrides.
- github.com/debug-js/debug/issues/1008: A user asks how to feed JSON output into a log pipeline.
- github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/debug/index.d.ts: Community-maintained TypeScript declarations.
- loggily.dev/guide/benchmarks.html: A competing logger's benchmark measures disabled-call overhead.
- fastify.dev/docs/latest/Reference/Logging: Pino offers severity thresholds, serializers, and redaction.
Holds up over time4.8
Will it still be a good choice in two years?
Claude Opus 5.5: 4.0, likely 3.0 to 6.0
The code is mature and stable, and so much depends on it that it will not vanish. Activity is near zero: 3 commits and no releases in the last year, 38 open pull requests, and no published v5 plan. Bluesky posts point to maintainer strain from security-report pressure.
- github commitsLastYear: 3 commits in the last year.
- github releasesLastYear: No releases since 4.4.3 in Sept 2025.
- github.com/debug-js/debug/releases: Recent releases are small fixes. No roadmap is visible.
- bluesky top: Posts about maintainer burnout from security reports.
GPT-6.2 Sol: 5.5, likely 4.2 to 6.8
The maintainer describes 4.x as being in stable maintenance and says genuine security issues would still get fixes. Three commits and zero releases in the past year make this a slower-moving choice than Pino. ESLint provides recurring sponsorship, but the project's modest budget and lack of a release roadmap make future maintenance capacity hard to judge.
- github.commitsLastYear and github.releasesLastYear: Three commits and zero releases in the past year.
- peers.Pino.commitsLastYear: Pino recorded 82 commits in the same period.
- github.com/debug-js/debug/issues/1064: The maintainer describes stable maintenance and a loosely planned major release with no timetable.
- github.com/debug-js/debug/releases/tag/4.4.3: The recovery release preserves 4.4.1 behavior.
- opencollective.com/debug: Shows recurring ESLint sponsorship and an estimated annual budget of $1,745.
Used widely7.1
How many use it, and is that growing?
Claude Opus 5.5: 7.0, likely 5.0 to 8.0
Its raw numbers are the largest in the category: 3.78B downloads in 4 weeks and 1.4M dependent repos. Most of that is transitive, through Express and similar packages, not a direct choice. Its growth ratio of about 2.3 is below the 4.1 median, so it is losing ground. Direct choices are still in the hundreds of thousands.
- npm downloadsLast4Weeks: 3.78B, versus 1.67B a year before, a ratio of about 2.26.
- medianDownloadsRatio: The median is 4.1, so debug is growing more slowly than the market.
- dependents.repos: 1.42M repos, mostly transitive.
GPT-6.2 Sol: 7.2, likely 5.6 to 8.5
ecosyste.ms found about 1.42 million dependent repositories and 46,672 dependent npm packages. Those counts and 11,460 stars suggest broad use, but the 3.78 billion four-week downloads are heavily inflated by indirect installs. Downloads rose 2.26 times year over year, below the 4.1 catalog benchmark and Pino's 5.10, which points to declining relative momentum. The number of new projects choosing debug directly remains uncertain.
- dependents and github.stars: About 1.42 million detected repositories, 46,672 npm packages, and 11,460 stars.
- npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, project.note, and medianDownloadsRatio: Downloads grew from 1.67 billion to 3.78 billion, with heavy indirect use and growth below the catalog median.
- peers.Pino.downloadsLast4Weeks and peers.Pino.downloadsSame4WeeksYearAgo: Pino's downloads grew 5.10 times in the same period.
- bluesky: Sixteen posts, with the most-liked posts mainly about security.
- github.com/vitejs/vite/pull/21137: Vite switched its diagnostics to obug.
Vouched for6.0
Who stands behind it being good?
Claude Opus 5.5: 5.0, likely 4.0 to 7.0
Major projects such as Express, Socket.IO and Mocha have used it for years. That shows trust for diagnostics, but those endorsements are old. Independent guides recommend it only as a development aid beside a real logger. No survey or benchmark backs it as an app logger.
- Express, Socket.IO and Mocha use debug: Long-standing use by major projects.
- npm-compare.com/@datadog/browser-logs,bunyan,debug,js-logger,log4js,loglevel,pino,winston: Recommended as a complement, not a replacement.
GPT-6.2 Sol: 6.9, likely 5.7 to 8.0
Express 5 and Socket.IO 4 both use debug for their own diagnostics, and ESLint provides recurring financial support. Users also report that the shared DEBUG convention helps when troubleshooting dependencies. These endorsements support the diagnostic use case, while evidence for debug as the main application logger is thin.
- expressjs.com/en/5x/guide/debugging: Express 5 uses debug internally and documents it for app diagnostics.
- socket.io/docs/v4/logging-and-debugging: Socket.IO 4 documents its instrumentation with debug.
- opencollective.com/debug: Shows a recent recurring sponsorship payment from ESLint.
- reddit.com/r/node/comments/123kvy0/error_handling_and_logging: A developer reports that shared use across modules makes diagnostics more flexible.
Safe5.1
How safe is it to depend on?
Claude Opus 5.5: 5.0, likely 3.0 to 6.0
It is MIT licensed and pulls in one dependency. In September 2025 a phishing takeover of the maintainer's account published debug@4.4.2 with crypto-stealing malware. It was removed within about two hours, but it reached roughly 10% of cloud environments. Old ReDoS issues were fixed. The Scorecard of 2.8 shows no branch protection, no security policy and no SAST.
- advisories recent: Malware advisory for 4.4.2, plus older ReDoS issues.
- wiz.io/blog/widespread-npm-supply-chain-attack-breaking-down-impact-scope-across-debug-chalk: Malicious versions were live about 2 hours and reached about 10% of cloud environments.
- paloaltonetworks.com/blog/cloud-security/NPM-supply-chain-attack: The maintainer confirmed the takeover and reverted the versions quickly.
- scorecard score: 2.8 overall. Maintained=1, Branch-Protection=0, Security-Policy=0.
- npm dependencies: One dependency (ms).
GPT-6.2 Sol: 5.2, likely 3.9 to 6.5
Version 4.4.3 has an MIT licence and one runtime dependency, and the older denial-of-service advisories affect earlier versions. npm removed the malicious 4.4.2 release the same day it appeared, and the maintainer published 4.4.3 five days later. The maintainer reported adding a hardware security key to the npm account, and npm lists two collaborators. OpenSSF scored the repository 2.8 out of 10, with zeroes for branch protection and security policy and limited visibility into publishing controls.
- npm.license, npm.dependencies, and scorecard.checks: MIT, one runtime dependency, and weak branch protection and security policy checks.
- github.com/debug-js/debug/security/advisories/GHSA-4x49-vf9v-38px: Confirms same-day removal and the clean 4.4.3 release five days later.
- github.com/advisories/GHSA-gxpj-cx7g-858c: Lists 4.3.1 as the patched 4.x version for the older advisory.
- github.com/advisories/GHSA-9vvw-cc9w-f27h: Lists affected versions and patches in older release lines.
- github.com/debug-js/debug/issues/1010: The trusted publishing proposal remains open, and the maintainer reports enabling a hardware security key.
- npmjs.com/package/debug?activeTab=dependents: The registry lists two collaborators.
Good
- Namespaced loggers turned on with DEBUG=app:* in Node or localStorage.debug in browsers are simple and well understood.
- It has one dependency (ms) and a tiny API that has hardly changed in years, so AI agents write correct code for it.
- It is the de facto convention for diagnostics across the Node ecosystem (Express, Socket.IO, Mocha and many more).
Bad
- It has no severity levels, no JSON or structured records and no transports, so it cannot be the main logger of a production app.
- Maintenance is very low: 3 commits and no releases in the last year, and 38 pull requests are open.
- The npm package ships no types. TypeScript users need @types/debug.
- debug@4.4.2 was published with crypto-stealing malware after a phishing takeover in September 2025, and the OpenSSF Scorecard is only 2.8.
The numbers
- npm downloads, 4 weeks
- 3.8B ×2.3 in a year
- GitHub stars
- 11k
- Commits, 12 months
- 3
- npm version
- 4.4.3 Sept 2025
- Versions, 12 months
- 0
- Advisories, 24 months
- 2 of 4 ever
- OpenSSF Scorecard
- 2.8 out of 10, Nov 2026
- Licence
- MIT
Many packages install it, so most downloads are not a direct choice.
Read on 21 November 2026 from GitHub (debug-js/debug), npm (debug), OSV and the OpenSSF Scorecard.