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 🙏

© 2024 – Pkg Stats / Ryan Hefner

code-inspector-plugin

v0.14.0

Published

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

Downloads

52,657

Readme

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

📖 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

💻 Try it out online

🎨 Support

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

🚀 Install

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

🌈 Usage

Please check here for more usage information: code-inspector-plugin configuration

  • 1.Configuring Build Tools

    // webpack.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = () => ({
      plugins: [
        codeInspectorPlugin({
          bundler: 'webpack',
        }),
      ],
    });
    // vite.config.js
    import { defineConfig } from 'vite';
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default defineConfig({
      plugins: [
        codeInspectorPlugin({
          bundler: 'vite',
        }),
      ],
    });
    // rspack.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = {
      // other config...
      plugins: [
        codeInspectorPlugin({
          bundler: 'rspack',
        }),
        // other plugins...
      ],
    };
    // rsbuild.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = {
      // other config...
      tools: {
        rspack: {
          plugins: [
            codeInspectorPlugin({
              bundler: 'rspack',
            }),
          ],
        },
      },
    };
    // vue.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = {
      // ...other code
      chainWebpack: (config) => {
        config.plugin('code-inspector-plugin').use(
          codeInspectorPlugin({
            bundler: 'webpack',
          })
        );
      },
    };

    For nuxt3.x :

    // nuxt.config.js
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    // https://nuxt.com/docs/api/configuration/nuxt-config
    export default defineNuxtConfig({
      vite: {
        plugins: [codeInspectorPlugin({ bundler: 'vite' })],
      },
    });

    For nuxt2.x :

    // nuxt.config.js
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default {
      build: {
        extend(config) {
          config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
          return config;
        },
      },
    };
    // next.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    const nextConfig = {
      webpack: (config, { dev, isServer }) => {
        config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
        return config;
      },
    };
    
    module.exports = nextConfig;
    // 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',
          })
        );
      },
      // other config
    });
    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default defineConfig({
      vite: {
        plugins: [codeInspectorPlugin({ bundler: 'vite' })],
      },
    });
  • 2.Configuring VSCode Command Line Tool

    Tip: Skip for Windows or other IDEs This step is only required for Mac with vscode as IDE. Skip this step if your computer is Windows or if you use another IDE.

    In VSCode, press command + shift + p, search for and click Shell Command: Install 'code' command in PATH:

    If you see the dialog box below, the configuration was successful:

  • 3.Enjoy using it

    When pressing the combination keys on the page, moving the mouse over the page will display a mask layer on the DOM with relevant information. Clicking will automatically open the IDE and position the cursor to the corresponding code location. (The default combination keys for Mac are Option + Shift; for Windows, it's Alt + Shift, and the browser console will output related combination key prompts)

👨‍💻 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 you can join the QQ group 769748484 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.