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

@winner-fed/plugin-code-inspector

v1.0.3

Published

WinJS 代码检查器插件,基于 [code-inspector-plugin](https://github.com/zh-lx/code-inspector) 封装,在开发环境中提供点击页面元素快速定位到源码文件的功能。

Readme

@winner-fed/plugin-code-inspector

WinJS 代码检查器插件,基于 code-inspector-plugin 封装,在开发环境中提供点击页面元素快速定位到源码文件的功能。

功能特性

  • 🎯 点击页面元素快速定位到源码文件
  • 🔧 支持 22+ 种主流 IDE(VSCode、Cursor、WebStorm 等)
  • ⌨️ 可自定义快捷键组合
  • 📱 支持移动端调试(开关按钮模式)
  • 🚀 支持 Vite、Webpack、Rspack 等打包工具
  • 🎨 仅在开发环境生效,零侵入生产代码

安装

npm add @winner-fed/plugin-code-inspector -D
# or
pnpm add @winner-fed/plugin-code-inspector -D

使用

.winrc.ts 中添加插件配置:

// .winrc.ts
export default {
  plugins: ['@winner-fed/plugin-code-inspector'],
  codeInspector: {
    // 默认配置已足够使用,以下为可选配置
  }
};

启动开发服务器后,按住 Alt + Shift 组合键(Mac 为 Option + Shift),然后点击页面元素,即可在 IDE 中打开对应的源码文件。

配置选项

editor

指定要打开的 IDE 编辑器。

  • Type: 'code' | 'cursor' | 'webstorm' | 'phpstorm' | 'idea' | ...
  • Default: 自动识别
  • 说明:插件会自动识别系统运行的 IDE,当同时运行多个 IDE 时可通过此配置指定
export default {
  plugins: ['@winner-fed/plugin-code-inspector'],
  codeInspector: {
    editor: 'cursor' // 指定使用 Cursor 编辑器
  }
};

hotKeys

触发源码定位的快捷键组合。

  • Type: Array<'ctrlKey' | 'altKey' | 'metaKey' | 'shiftKey'>
  • Default: ['altKey', 'shiftKey']
  • 说明:设置为空数组则关闭快捷键功能
export default {
  plugins: ['@winner-fed/plugin-code-inspector'],
  codeInspector: {
    hotKeys: ['metaKey', 'shiftKey'] // Mac: Cmd + Shift,Windows: Win + Shift
  }
};

showSwitch

是否在页面显示开关按钮来控制源码定位功能。

  • Type: boolean
  • Default: false
  • 说明:移动端开发时推荐开启此选项
export default {
  plugins: ['@winner-fed/plugin-code-inspector'],
  codeInspector: {
    showSwitch: true
  }
};

behavior

定义点击元素时的行为配置。

  • Type: { locate?: boolean; copy?: boolean | string; target?: string }
  • Default: { locate: true, copy: true }
export default {
  plugins: ['@winner-fed/plugin-code-inspector'],
  codeInspector: {
    behavior: {
      locate: true, // 是否跳转 IDE
      copy: '{file}:{line}:{column}', // 复制源码位置信息
      target: 'https://github.com/your-repo/blob/main/{file}#L{line}' // 自定义跳转 URL
    }
  }
};

更多配置

插件支持更多配置项,包括:

  • autoToggle - 触发跳转后自动关闭开关
  • dev - 手动指定开发环境
  • enforcePre - 控制编译顺序
  • ip - 服务器通信地址
  • port - 服务器端口号
  • hideConsole - 隐藏控制台提示
  • hideDomPathAttr - 隐藏 DOM 属性
  • include / exclude - 文件过滤规则
  • escapeTags - 跳过的 HTML 标签
  • openIn - IDE 窗口打开方式
  • pathType - 路径类型(相对/绝对)
  • printServer - 打印服务器信息
  • cache - 缓存控制
  • skipSnippets - 跳过代码片段注入

完整配置文档请参考:code-inspector-plugin 官方文档

支持的 IDE

code、cursor、webstorm、appcode、atom、atom-beta、brackets、code-insiders、codium、colin、emacs、goland、hbuilder、idea、notepad、phpstorm、pycharm、rider、rubymine、sublime、vim、zed

License

MIT