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

@deepfuture/dui-inspector

v0.0.22

Published

Runtime introspection for web component design systems built on dui-primitives. Inspect properties, tokens, slots, parts, style layers, and events. Mutate state live. Export changesets. Works headlessly for AI agent integration.

Readme

dui-inspector

Runtime introspection and mutation tool for web component design systems built on dui-primitives.

Inspect properties, tokens, slots, parts, style layers, and events. Mutate state live. Export changesets. Works headlessly for AI agent integration.

Install

npm install @deepfuture/dui-inspector

Usage

Full inspector (API + visual UI)

import "@deepfuture/dui-inspector";

This auto-mounts the visual inspector overlay and exposes the headless API on window.

Headless API only (for agents)

import "@deepfuture/dui-inspector/api";

Exposes window globals without mounting any UI:

// Inspect the entire page
window.__dui_inspect();

// Inspect a specific element
window.__dui_inspect('[data-dui-id="1"]');

// Mutations
window.__dui_mutate.setProp(selector, "variant", "outline");
window.__dui_mutate.setToken("--accent", "oklch(0.7 0.2 280)");
window.__dui_mutate.setComponentToken(selector, "--button-bg", "red");
window.__dui_mutate.setSlotContent(selector, "", "<span>New text</span>");
window.__dui_mutate.insertComponent(parentSelector, "beforeend", "dui-button", { variant: "outline" }, "Click me");
window.__dui_mutate.removeComponent(selector);
window.__dui_mutate.moveComponent(selector, newParentSelector, "afterend");

// Changelog
window.__dui_changelog.entries();
window.__dui_changelog.undo();
window.__dui_changelog.clear();

// Source map export
window.__dui_export();

// Observe mutations in real-time
const unsub = window.__dui_observe((entry) => console.log(entry));

How it works

The inspector has zero dependencies on any specific DUI design system. It works entirely through DOM introspection:

  • Discovers components by walking the DOM and shadow roots (configurable prefix, default dui-)
  • Reads properties via Lit's elementProperties static map
  • Scans adopted stylesheets for var(--*) token references
  • Resolves computed token values via getComputedStyle
  • Detects slots and parts by querying shadow DOM
  • Scans prototype method source for dispatchEvent calls to find events
  • Analyzes style layers by adopted stylesheet position

This means it works with any component library built on dui-primitives — not just one particular design system.

Configuration

import { init } from "@deepfuture/dui-inspector";

init({
  sourceMap: {
    tokens: "src/tokens.css",
    page: "src/app.ts",
    themeStyles: {
      "dui-button": "src/theme/button.ts",
    },
  },
});

The source map configuration tells __dui_export() which source files correspond to runtime mutations, so AI agents can map changes back to code.

License

MIT