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

xebug

v0.1.0

Published

A lightweight, zero-dependency in-browser debugging tool that runs entirely in the client. No build step, no server required — just drop a script tag and start debugging.

Readme

🐛 Xebug

A lightweight, zero-dependency in-browser debugging tool that runs entirely in the client. No build step, no server required — just drop a script tag and start debugging.

Features

  • Elements Inspector — Browse the DOM tree, hover to highlight elements, click to view computed styles, inline styles, and matched CSS rules.
  • Network Monitor — Intercept and inspect fetch and XMLHttpRequest requests with full request/response headers and body viewing.
  • Storage Manager — View, edit, and delete localStorage, sessionStorage, and cookies.
  • Console — Capture console.log/warn/error output and evaluate JavaScript expressions directly from the panel.
  • Floating & Docked Modes — Drag, resize, and toggle between floating window and bottom-docked panel.
  • Mobile-Friendly — Full touch support for dragging and resizing on mobile devices.
  • Shadow DOM Isolated — All UI components use Shadow DOM to avoid style conflicts with the host page.

Quick Start

Add a single script tag to your page:

<script type="module" src="https://lsong.org/xebug/init.js"></script>

That's it. A 🐛 button appears in the bottom-right corner. Click it to open the DevTools panel.

👉 View Live Demo

Bookmarklet

Drag this link to your bookmarks bar, or copy and paste into the browser address bar to enable Xebug on any page:

javascript:(()=>{const s=document.createElement('script');s.type='module';s.src='https://lsong.org/xebug/init.js';document.body.appendChild(s)})();

Xebug Debugger

Architecture

xebug/
├── init.js              ← All-in-one entry (FloatBtn + injectAgent + initXebugUI)
├── agent/               ← Runs inside the page, hooks into APIs
│   ├── index.js         ← Agent class
│   ├── dom-handler.js   ← DOM tree serialization & style inspection
│   ├── network-handler.js← Fetch/XHR interception
│   ├── console-handler.js← Console method interception
│   └── storage-handler.js← localStorage/sessionStorage/cookies
├── ui/                  ← DevTools panel UI (Web Components)
│   ├── index.js         ← <xebug-panel> + views registration
│   └── views/
│       ├── dom.js       ← DOM tree view with style panel
│       ├── network.js   ← Network table with request/response detail
│       ├── console.js   ← Console output & expression evaluator
│       └── storage.js   ← Storage viewer/editor
├── protocol/            ← Message types & transport layer
│   ├── messages.js      ← Message type constants & factories
│   ├── transport.js     ← LocalTransport (BroadcastChannel)
│   └── index.js         ← Re-exports
└── example/
    └── index.html       ← Demo page with test functions

Advanced Usage

Manual Initialization

If you need fine-grained control, import and initialize components individually:

import { Agent } from './agent/index.js';

const agent = new Agent();
agent.connect();

Custom Views

Register your own panels:


class MyCustomView {
  static css() { return '.my-view { color: red; }'; }
  get id() { return 'custom'; }
  get label() { return 'My View'; }
  render(container, transport) { /* ... */ }
  wireTransport(transport) { /* ... */ }
}

XebugPanel.register(MyCustomView);

Custom Handlers

Add your own agent-side handlers:

import { Agent } from './agent/index.js';

// Create and connect agent
const agent = new Agent();
agent.connect();

// Access the transport to add custom message handlers
const transport = agent.getTransport();
transport.on('my:customMessage', (msg) => {
  // Handle custom message
});

Browser Support

  • Chrome 88+
  • Edge 88+
  • Safari 14.1+
  • Firefox 100+

Requires support for:

  • ES Modules
  • Custom Elements v1
  • Shadow DOM v1
  • CSSStyleSheet.prototype.replaceSync()
  • BroadcastChannel API

License

MIT