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

@stinsky/xray

v0.3.3

Published

React dev inspector — hover to see component names, click to open source in your editor. Works with React 19 + Turbopack.

Downloads

720

Readme

Features

  • Click to open source — click any element to open its source file in VS Code, WebStorm, IntelliJ, or any editor
  • Component name overlay — hover to see the React component name + file path
  • Works with React 19 — uses compile-time AST injection, not fiber._debugSource (removed in React 19)
  • All bundlers — Next.js (Turbopack & Webpack), Vite, Webpack, Rspack, esbuild
  • Zero production cost — fully tree-shaken, zero bytes in your production bundle
  • Floating toggle button — auto-follows the Next.js dev indicator, or freely draggable with snap-to-corner in other setups
  • Keyboard shortcutCmd+Shift+X to toggle (customizable)
  • Scroll-aware — rAF-based tracking, works with smooth scrolling libraries (Lenis, etc.)
  • Interaction blocking — all clicks/pointer events blocked while inspecting, no accidental navigation

Why not react-dev-inspector / click-to-react-component / LocatorJS?

React 19 removed fiber._debugSource, which broke every existing click-to-component tool. These packages rely on runtime fiber inspection to find source locations — an approach that no longer works.

@stinsky/xray uses code-inspector-plugin to inject data-insp-path attributes at compile time via AST transformation. This is the only approach that works reliably across React 18, React 19, and all modern bundlers.

Install

npm install -D @stinsky/xray

Setup

1. Add the build plugin

The plugin injects source location attributes on every DOM element at compile time. It does nothing in production builds.

Next.js (Turbopack)

// next.config.ts
import { xrayPlugin } from '@stinsky/xray/plugin'

const nextConfig = {
  turbopack: {
    rules: xrayPlugin({ bundler: 'turbopack' }),
  },
}

export default nextConfig

Next.js (Webpack)

// next.config.ts
import { xrayPlugin } from '@stinsky/xray/plugin'

const nextConfig = {
  webpack: (config) => {
    config.plugins.push(xrayPlugin({ bundler: 'webpack' }))
    return config
  },
}

export default nextConfig

Vite

// vite.config.ts
import { xrayPlugin } from '@stinsky/xray/plugin'

export default {
  plugins: [xrayPlugin({ bundler: 'vite' })],
}

Webpack

// webpack.config.js
const { xrayPlugin } = require('@stinsky/xray/plugin')

module.exports = {
  plugins: [xrayPlugin({ bundler: 'webpack' })],
}

2. Add the component

// app/layout.tsx (Next.js) or your root component
import { Xray } from '@stinsky/xray'

export default function Layout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Xray />
      </body>
    </html>
  )
}

The component is fully tree-shaken in production — zero bytes in your bundle. Bundlers replace process.env.NODE_ENV, detect the dead code path, and eliminate the entire inspector along with all its dependencies.

Usage

  • Toggle: Cmd+Shift+X or click the floating button
  • Hover: Shows component name + source file path
  • Click: Opens the source file in your editor

All clicks and pointer events are blocked while the inspector is active, so you won't accidentally trigger links or buttons.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | hotKey | { metaKey?, ctrlKey?, altKey?, shiftKey?, key } | { metaKey: true, shiftKey: true, key: 'x' } | Keyboard shortcut to toggle | | port | number | 5678 | code-inspector-plugin server port | | color | string | '#6366f1' | Accent color for overlay, tooltip, and button | | showButton | boolean | true | Show the floating toggle button | | followNextIndicator | boolean | true | Position button next to the Next.js dev indicator |

Plugin options

| Option | Type | Default | Description | |--------|------|---------|-------------| | bundler | 'webpack' \| 'vite' \| 'turbopack' \| 'rspack' \| 'esbuild' | — | Required. Your bundler | | editor | string | 'code' | Editor to open files in (code, webstorm, idea, etc.) |

Acknowledgments

Built on top of code-inspector-plugin, which handles the compile-time AST injection and editor integration.

License

MIT