npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jarrodek/debug

v1.0.0

Published

A port of the debug library that is an ESM and works in a web browser

Readme


🌟 Features

  • Drop-in Replacement: Fully API-compatible with Node.js util.debuglog.
  • Modern & Lightweight: Built as an ESM module, tailored for modern web environments.
  • Native DevTools Integration: Seamlessly leverages browser DevTools formatting (%o, %O, %d, %s) for interactive object exploration.
  • Robust Stringification: Safely handles %j with circular reference protection.
  • Namespacing & Wildcards: Full support for glob-style * wildcards and negation patterns (e.g., app:*,-app:verbose).
  • Dynamic Styling: Automatically hashes namespaces to a diverse CSS color palette for easy visual grepping.

📦 Installation

npm install @jarrodek/debug

🚀 Usage

Import the debuglog factory and create a logger instance bound to a specific namespace:

import { debuglog } from '@jarrodek/debug';

const log = debuglog('my-module');

// Basic logging
log('Module initialized successfully.');

// Formatting
log('Received payload from %s: %O', 'auth-service', { id: 123, status: 'active' });

⚙️ Configuration

Just like the Node.js module, you can control which loggers are active and whether colors are rendered. In a web environment, this is managed via localStorage or sessionStorage (with sessionStorage taking precedence).

Enabling Namespaces

Set the DEBUG or NODE_DEBUG key to a comma-separated list of namespaces.

// Enable a specific module
localStorage.setItem('DEBUG', 'my-module');

// Enable all modules under 'app:', but exclude 'app:verbose'
localStorage.setItem('DEBUG', 'app:*,-app:verbose');

// Enable everything
localStorage.setItem('DEBUG', '*');

Controlling Colors

By default, colored output is enabled. If you need to disable it (e.g., for plain text log scraping), set DEBUG_COLORS to false or 0.

localStorage.setItem('DEBUG_COLORS', '0');

🛠 Formatters

The library uses printf-style formatting, delegating to the native browser console.debug engine to preserve object interactivity wherever possible.

| Format | Description | |--------|-------------| | %O | Pretty-print an Object (rendered natively by browser DevTools). | | %o | Pretty-print an Object (rendered natively by browser DevTools). | | %s | String format. | | %d | Number format (both integer and float). | | %j | JSON format. Safely stringifies and replaces circular references with "[Circular]". | | %% | Escapes a single percent sign ('%'). Does not consume an argument. |

📄 License

Apache-2.0 © Pawel Uchida-Psztyc