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

@neurora/code-inspector-plugin

v1.3.7

Published

Click the dom on the page, it will open your IDE and position the cursor to the source code location of the dom.

Readme

NPM version GITHUB star NPM Downloads MIT-license GITHUB-language

📖 Introduction

Click the element on the page, it can automatically open the code editor and position the cursor to the source code of the element.

code-inspector

✨ New Feature: Floating Ball Mode

The plugin now supports a floating ball interface for easier interaction:

  • 🎯 Draggable floating ball - Position it anywhere on your screen
  • 🔄 Mode switching - Toggle between "Copy Path" and "Open Editor" modes with a single click
  • 🎨 Visual feedback - Different colors and tooltips for each mode
  • 💾 Persistent state - Remembers your preferred position and mode across sessions

💻 Try it out online

🎨 Support

The following are which compilers, web frameworks and editors we supported now:

🚀 Install

Standard Version

npm i code-inspector-plugin -D
# or
yarn add code-inspector-plugin -D
# or
pnpm add code-inspector-plugin -D

Enhanced Version (with Floating Ball Feature)

For the latest features including the floating ball interface:

npm i @neurora/code-inspector-plugin -D
# or
yarn add @neurora/code-inspector-plugin -D
# or
pnpm add @neurora/code-inspector-plugin -D

🌈 Usage

Quick Setup with Floating Ball

To enable the floating ball feature, add the behavior configuration:

// vite.config.js
import { defineConfig } from 'vite';
import { codeInspectorPlugin } from 'code-inspector-plugin';
// or use @neurora/code-inspector-plugin for guaranteed floating ball support

export default defineConfig({
  plugins: [
    codeInspectorPlugin({
      bundler: 'vite',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Enable floating ball mode
      }
    }),
  ],
});

Configuration Examples

// webpack.config.js
const { codeInspectorPlugin } = require('code-inspector-plugin');

module.exports = () => ({
  plugins: [
    codeInspectorPlugin({
      bundler: 'webpack',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    }),
  ],
});
// vite.config.js
import { defineConfig } from 'vite';
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default defineConfig({
  plugins: [
    codeInspectorPlugin({
      bundler: 'vite',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    }),
  ],
});
// rspack.config.js
const { codeInspectorPlugin } = require('code-inspector-plugin');

module.exports = {
  plugins: [
    codeInspectorPlugin({
      bundler: 'rspack',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    }),
  ],
};
// rsbuild.config.js
const { codeInspectorPlugin } = require('code-inspector-plugin');

module.exports = {
  tools: {
    rspack: {
      plugins: [
        codeInspectorPlugin({
          bundler: 'rspack',
          behavior: {
            enable: true,
            enableFloatingBall: true  // Optional: enable floating ball
          }
        }),
      ],
    },
  },
};
// esbuild.config.js
const esbuild = require('esbuild');
const { codeInspectorPlugin } = require('code-inspector-plugin');

esbuild.build({
  plugins: [codeInspectorPlugin({ 
    bundler: 'esbuild', 
    dev: () => true,  // Return true in dev, false in production
    behavior: {
      enable: true,
      enableFloatingBall: true  // Optional: enable floating ball
    }
  })],
});
// farm.config.js
import { defineConfig } from '@farmfe/core';
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default defineConfig({
  vitePlugins: [
    codeInspectorPlugin({
      bundler: 'vite',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    }),
  ],
});
// vue.config.js
const { codeInspectorPlugin } = require('code-inspector-plugin');

module.exports = {
  chainWebpack: (config) => {
    config.plugin('code-inspector-plugin').use(
      codeInspectorPlugin({
        bundler: 'webpack',
        behavior: {
          enable: true,
          enableFloatingBall: true  // Optional: enable floating ball
        }
      })
    );
  },
};

For nuxt3.x:

// nuxt.config.js
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default defineNuxtConfig({
  vite: {
    plugins: [codeInspectorPlugin({ 
      bundler: 'vite',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    })],
  },
});

For nuxt2.x:

// nuxt.config.js
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default {
  build: {
    extend(config) {
      config.plugins.push(codeInspectorPlugin({ 
        bundler: 'webpack',
        behavior: {
          enable: true,
          enableFloatingBall: true  // Optional: enable floating ball
        }
      }));
      return config;
    },
  },
};

For next.js(<= 14.x):

// next.config.js
const { codeInspectorPlugin } = require('code-inspector-plugin');

const nextConfig = {
  webpack: (config, { dev, isServer }) => {
    config.plugins.push(codeInspectorPlugin({ 
      bundler: 'webpack',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    }));
    return config;
  },
};

module.exports = nextConfig;

For next.js(15.0.x ~ 15.2.x):

import type { NextConfig } from 'next';
import { codeInspectorPlugin } from 'code-inspector-plugin';

const nextConfig: NextConfig = {
  experimental: {
    turbo: {
      rules: codeInspectorPlugin({
        bundler: 'turbopack',
        behavior: {
          enable: true,
          enableFloatingBall: true  // Optional: enable floating ball
        }
      }),
    },
  },
};

export default nextConfig;

For next.js(>= 15.3.x):

// next.config.js
import type { NextConfig } from 'next';
import { codeInspectorPlugin } from 'code-inspector-plugin';

const nextConfig: NextConfig = {
  turbopack: {
    rules: codeInspectorPlugin({
      bundler: 'turbopack',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    }),
  },
};

export default nextConfig;

With webpack:

// umi.config.js or umirc.js
import { defineConfig } from '@umijs/max';
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default defineConfig({
  chainWebpack(memo) {
    memo.plugin('code-inspector-plugin').use(
      codeInspectorPlugin({
        bundler: 'webpack',
        behavior: {
          enable: true,
          enableFloatingBall: true  // Optional: enable floating ball
        }
      })
    );
  },
});

With mako:

// .umirc.ts
import { defineConfig } from 'umi';
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default defineConfig({
  mako: {
    plugins: [
      codeInspectorPlugin({
        bundler: 'mako',
        behavior: {
          enable: true,
          enableFloatingBall: true  // Optional: enable floating ball
        }
      }),
    ],
  },
});
// astro.config.mjs
import { defineConfig } from 'astro/config';
import { codeInspectorPlugin } from 'code-inspector-plugin';

export default defineConfig({
  vite: {
    plugins: [codeInspectorPlugin({ 
      bundler: 'vite',
      behavior: {
        enable: true,
        enableFloatingBall: true  // Optional: enable floating ball
      }
    })],
  },
});

🎮 How to Use

With Floating Ball Mode (New!)

When enableFloatingBall: true is configured:

  1. A draggable floating ball appears on your page
  2. Click the ball to switch between modes:
    • 📋 Copy Path Mode (Blue) - Click elements to copy their source file path
    • 📝 Open Editor Mode (Green) - Click elements to open them in your IDE
  3. Drag the ball anywhere on your screen for convenience
  4. Your preferences (position and mode) are saved automatically

Traditional Keyboard Mode

When using keyboard shortcuts:

  1. Press the combination keys (Option + Shift on Mac, Alt + Shift on Windows)
  2. Move your mouse over any element to see its source information
  3. Click to open the element in your IDE at the exact line

🔧 Configuration Options

{
  bundler: 'vite',              // Required: 'vite' | 'webpack' | 'rspack' | ...
  behavior: {
    enable: true,                // Enable the plugin
    enableFloatingBall: true,    // Enable floating ball UI (new feature!)
    locate: true,                // Show element location on hover
    copy: true,                  // Allow copying file path
  },
  hotKeys: ['altKey', 'shiftKey'], // Customize keyboard shortcuts
  showSwitch: true,             // Show toggle switch in dev tools
  autoToggle: true,             // Auto-enable in development
  hideConsole: false,           // Hide console hints
  dev: true,                    // Enable in development mode
  enforce: 'pre',               // Plugin enforce timing
  importClient: 'es6',          // Import syntax: 'es6' | 'code'
  escapeTags: [],               // Tags to ignore
  pathFormat: ['relative', 'absolute'], // Path format in tooltip
  includeUrl: /\.(vue|jsx|tsx)$/, // Files to include
  excludeUrl: /node_modules/,  // Files to exclude
}

📦 Package Ecosystem

Official Packages

  • code-inspector-plugin - Main plugin package
  • @code-inspector/core - Core functionality
  • @code-inspector/vite - Vite integration
  • @code-inspector/webpack - Webpack integration
  • @code-inspector/esbuild - Esbuild integration

Enhanced Packages (with Floating Ball)

  • @neurora/code-inspector-plugin - Enhanced main plugin with floating ball
  • @neurora/code-inspector-core - Enhanced core with floating ball support
  • @neurora/code-inspector-vite - Enhanced Vite integration

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

👨‍💻 Contributors

Special thanks to the contributors of this project:

📧 Communication and Feedback

For any usage issues, please leave a message below my Twitter post or submit an issue on Github.

For Chinese users, you can join the QQ group 769748484 or add the author's WeiXin account zhoulx1688888 for consultation and feedback:

💖 Sponsor

Sponsoring this project can help the author create better. If you are willing, thanks for sponsoring me through here.

📄 License

MIT © zh-lx

Star History

Star History Chart