debug

A tiny, zero-config JavaScript debugging utility with namespaced, color-coded output for Node.js and the browser.

Library
npm
v4.4.3
11,458 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
62 /100 Good
Development Activity 48
Maintenance 24
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 86
Code Quality 82
Innovation 92
Learning Curve 90

debug is a minimalist JavaScript debugging utility modelled after Node.js core’s own internal debugging technique. It lets you wrap conditional log output in named debug instances that stay completely silent in production unless explicitly enabled, so you can sprinkle diagnostic statements throughout a codebase without paying a runtime cost or cluttering normal output.

Output is toggled entirely through the DEBUG environment variable (or localStorage.debug in the browser), with wildcard and exclusion patterns for selecting exactly which namespaces to surface. Each namespace gets an automatic color, printf-style formatters, and millisecond timing diffs between calls, making it one of the most widely depended-on packages in the npm ecosystem.

What You Get

  • A tiny factory API: require('debug')('namespace') returns a ready-to-use logging function
  • Runtime enable/disable controlled by the DEBUG env var (or localStorage.debug in browsers) with wildcard and exclusion patterns
  • Automatic per-namespace colors and millisecond timing diffs between successive calls
  • printf-style formatters (%o, %O, %s, %d, %j) plus support for registering custom formatters
  • Isomorphic builds for both Node.js and the browser from a single package

Common Use Cases

  • Instrumenting a library so downstream consumers can toggle its internal logging without code changes
  • Adding low-overhead, namespaced diagnostics to an application that stay quiet in production
  • Selectively enabling logs from specific subsystems (e.g. DEBUG=app:db,app:http) while excluding noisy ones

Under The Hood

Architecture — The package is deliberately small and factored around a shared core: src/index.js sniffs the runtime (checking process.type, process.browser, and process.__nwjs) and delegates to either src/node.js or src/browser.js, each of which supplies environment-specific concerns (color detection, output stream, env parsing) into the common setup(env) factory in src/common.js. That factory builds the createDebug function, whose per-namespace debug closure tracks previous timestamps, computes millisecond diffs, applies formatters, and short-circuits immediately when disabled.

Tech Stack — Pure JavaScript targeting node >=6, with a single runtime dependency (ms for humanizing time diffs) and an optional supports-color peer dependency for richer Node color output. Browser bundles are produced with browserify; tests run on mocha with sinon, and karma drives the browser test suite. Linting is handled by xo.

Code Quality — The codebase is compact and well-commented, with a clear separation between shared logic and platform adapters. Tests exist (test.js plus test.node.js) covering enable/disable semantics, formatting, and namespace matching, run through mocha and karma. The narrow API surface and long production history across hundreds of millions of weekly downloads make it battle-tested.

API Design — The public API is exceptionally ergonomic: require('debug')('namespace') returns a callable logger, and everything else (wildcards, exclusions, .extend(), .enable()/.disable(), custom formatters, per-instance log overrides) layers on without ceremony. Zero configuration is required to get started, and runtime control via the DEBUG env var means instrumentation needs no code changes to toggle.

Used by 32 apps in this directory

TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

259,694

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
82
Repo Health
89
Technical
73
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,443

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
57
Repo Health
90
Technical
61
Dependency
Built with
Java 34%
TypeScript 27%
Scala 26%
Updated 2 months ago
TypeScript
94%
Apache 2.0

flue

AI Agents · Developer Tools

8,521

Build autonomous AI agents and powerful workflows with a programmable TypeScript harness that gives any model sessions, tools, sandboxes, and durable execution.

View details
81
Repo Health
82
Technical
69
Dependency
Built with
TypeScript 94%
Updated 2 weeks ago
TypeScript
54%
MIT

FormBee

Forms Surveys

769

A self-hostable form backend that accepts HTML form submissions and routes them to email, Telegram, Discord, webhooks, and automation platforms — without writing any server-side code.

View details
41
Repo Health
48
Technical
70
Dependency
Built with
TypeScript 54%
SCSS 25%
HTML 19%
Updated 1 months ago
TypeScript
91%
Apache 2.0

HyperFrames

AI Design Tools · AI Development

70,938

Turn plain HTML and CSS into deterministic, pixel-perfect MP4 videos — authored by humans or AI agents, rendered by headless Chrome and FFmpeg.

View details
84
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago
TypeScript
98%
Other

LobeHub

AI Assistants · Automation · Productivity

83,455

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
Clojure
71%
AGPL 3.0

Logseq

Knowledge Management · Note Taking

45,349

A privacy-first, open-source knowledge graph platform combining Markdown, Org-mode, bidirectional linking, and local-first storage for building your second brain.

View details
92
Repo Health
82
Technical
65
Dependency
Built with
Clojure 71%
OCaml 12%
Updated 1 weeks ago
TypeScript
98%
MPL 2.0

Logto

Authentication

14,769

Open-source auth infrastructure for SaaS and AI apps with OIDC, SAML, and RBAC

View details
92
Repo Health
83
Technical
63
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
Ruby
59%
AGPL 3.0

Mastodon

Social Media

50,441

Run your own federated social network on the open ActivityPub standard with no ads, no algorithms, and no corporate control over your community.

View details
95
Repo Health
81
Technical
70
Dependency
Built with
Ruby 59%
TypeScript 24%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers