A tiny JavaScript debugging utility modeled after Node.js core's debugging technique, working in Node.js and browsers.
debug is a lightweight JavaScript debugging utility that provides namespaced, controllable logging for both Node.js and browser environments. It solves the problem of messy, uncontrolled console.log statements by allowing developers to enable or disable debug output for specific modules or features using environment variables or localStorage. This makes it easier to isolate and troubleshoot issues during development without cluttering production logs.
JavaScript developers building Node.js applications, web applications, or libraries who need a structured way to manage debug output across different environments and deployment stages.
Developers choose debug for its simplicity, cross-platform compatibility, and fine-grained control over logging. Unlike built-in console methods, it offers namespace organization, color-coded output, and runtime configurability without adding significant overhead to the codebase.
A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses colon-separated namespaces like 'app:http' to toggle debugging per module, allowing fine-grained control via the DEBUG environment variable with wildcards, as shown in the README examples.
Works seamlessly in Node.js and browsers, with browserify compatibility and localStorage persistence for web, making it versatile for full-stack development.
Provides color-coded output per namespace and millisecond diffs between logs, helping quickly parse logs and identify performance bottlenecks, as demonstrated in the terminal and browser screenshots.
Allows enabling or disabling debuggers programmatically with enable() and disable() methods, offering flexibility without restarting applications, as detailed in the 'Set dynamically' section.
Lacks built-in support for severity levels like INFO or WARN, limiting its utility for production monitoring where structured logging with priorities is essential.
Setting DEBUG variables can be complex, especially on Windows with different syntax for CMD and PowerShell, as the README notes, adding setup overhead.
In Chromium browsers, debug messages only appear in the 'Verbose' log level by default, requiring users to manually adjust console settings, which can lead to missed logs.
Focuses on development debugging without features like log rotation, external transports, or advanced formatting, making it unsuitable for robust production logging out of the box.