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

@stanko/kaplay-inspector

v0.1.5

Published

A dev tool for Kaplay which allows you to explore and inspect the game object tree real time.

Readme

Kaplay Inspector

A dev tool for Kaplay which allows you to explore and inspect the game object tree real time.

Kaplay inspector in action

Features

  • Navigate the game object tree
  • Updates every 100ms (configurable)
  • Hover an object to draw it's area, anchor and bounding box
  • Inspect object's component and custom props
  • Log an object to console
  • Tweak position, text or color
  • Pause objects
  • Hide objects
  • Search for tags or comps
  • Dark theme (is this a feature?)

The layout is made with desktop in mind. That said, it is somewhat usable on phones.

Usage

Install it:

npm install @stanko/kaplay-inspector

This is a dev tool, so I strongly recommend you import it only in development mode. This will prevent from the inspector showing up when you ship your game to players.

If you are using vite, it exposes the dev flag in import.meta.env.DEV. For other bundlers check their documentation.

You'll need to import the CSS and init method, here is an example using vite:

import kaplay from "kaplay";

// Init you kaplay game
const k = kaplay({})

if (
  // Make sure to load it only in development mode
  import.meta.env.DEV &&
  // I like to enable it only when ?inspector is available in the URL (this is optional)
  // This gives you an easy way to enable or disable it
  new URLSearchParams(window.location.search).get("inspector") !== null
) {
  import("@stanko/kaplay-inspector/dist/styles.css");
  import("@stanko/kaplay-inspector").then(({ default: init }) => {
    // Pass the "k" instance to the inspector
    init(k);
  });
}

If typescript is complaining about importing CSS files, you probably need to add this to declaration.d.ts file in you project's root.

declare module '*.scss';

Options

You can pass options object to the init method as a second parameter:

init(k, {
  updateTimeout: 100,
})

available options are:

interface InspectorOptions {
  // CSS class to add to the root element
  className?: string; 
  // is inspector visible on load, default: true
  isVisible?: boolean; 
  // default update time in milliseconds, default: 250
  initUpdateTimeout?: number; 
  // should area, anchor and bounding box be drawn on object hover, default: true
  shouldDrawInspect?: boolean: 
}

Customizing colors

Kaplay Inspector defines colors in OKLCH color space. This makes changing of the primary and the secondary color pretty straight forward. You only need to update two hue variables like this:

.k-inspector.your-custom-class {
  --ki-h: 300; /* Purple */
  --ki-h-secondary: 200; /* Teal */
}

Please note that if you load inspector's CSS dynamically, you'll have to add a custom class to create a higher specificity selector.

If you want to change other colors as well, check the styles.css.

Positioning

By default, the inspector has position: fixed and it sits at the bottom of the screen. If you want to move it around, the easiest way it to pass a custom class name through the options and position it yourself.

Assuming we have only the canvas and the inspector element on the page, here is an example of what I like to do:

body:has(.k-inspector__hide) {
  display: grid;
  grid-template-rows: 60vh 40vh;

  canvas {
    width: 100% !important;
    height: 60vh !important;
    object-fit: contain;
    display: block;
  }

  .k-inspector {
    position: relative;
  }
}

This fixed the game canvas in the upper part of the viewport (60% of it) and the bottom part is taken by the inspector. It only applies this layout when inspector is visible (by checking if the hide button is shown).

Same as with colors, be sure to have a higher specificity selector if inspector's CSS is loaded dynamically.

TODO

  • [ ] Controllable theme - system/light/dark. At the moment it is always matching the system.
  • [ ] Filter/search
  • [ ] Persist search in URL or local storage
  • [ ] Collapse/Expand all button