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 🙏

© 2025 – Pkg Stats / Ryan Hefner

click2component

v0.5.9

Published

A development tool for locating Vue components by clicking elements in the browser

Readme

Click2Component

English | 中文

English

Introduction

Click2Component is a Vue.js plugin that enables quick navigation to component source code, supporting both Vue 2 and Vue 3.

Features

  • Quick component location with Alt + Click
  • Precise line number detection
  • Smart file path hints
  • Third-party component support
  • Editor integration
  • User-friendly UI

Installation

npm install click2component -D
# 或
yarn add click2component -D

Usage

Vue 3

import { createApp } from "vue";
import Click2Component from "click2component";

const app = createApp(App);
app.use(Click2Component);
app.mount("#app");

Vue 2

import Vue from "vue";
import Click2Component from "click2component";

Vue.use(Click2Component);

Configuration

app.use(Click2Component, {
  enabled: true, // Enable/disable the plugin
  key: "Alt", // Trigger key (Alt/Shift/Control/Meta)
  defaultEditor: "vscode", // Default editor
});

How to Use

  1. Hold the Alt key (or your configured key)
  2. Hover over a component to see its file path
  3. Click to open the component in your editor

Special Features

  • Third-party Component Navigation: Supports jumping to node_modules source code
  • Precise Line Detection: Accurately locates text content and elements
  • File Path Display: Shows component file path in top-left corner when hovering

Supported Editors

  • VS Code (vscode://file)
  • Cursor (cursor://file)
  • Trae (trae://file)

Important Notes

  • Source maps must be enabled in your project
  • Editor must support URL protocol opening

Debugging

When navigating to components, the console will show:

[Click2Component] Jump to: {
  file: "path/to/component.vue",
  line: 1
}

Vue CLI 4.x Support

Click2Component now automatically detects the project root path in Vue CLI 4.x projects. No additional configuration is needed! The plugin will:

  1. Automatically detect the webpack environment
  2. Find the correct project root path from Vue CLI configuration
  3. Resolve component paths correctly for editor navigation

Just install and use as normal:

// Vue 3
import { createApp } from "vue";
import Click2Component from "click2component";

const app = createApp(App);
app.use(Click2Component);
app.mount("#app");

// Vue 2
import Vue from "vue";
import Click2Component from "click2component";

Vue.use(Click2Component);

License

MIT


中文

简介

Click2Component 是一个 Vue.js 插件,支持快速定位并跳转到组件源代码,同时支持 Vue 2 和 Vue 3。

特性

  • Alt + 点击快速定位组件
  • 精确的行号检测
  • 智能文件路径提示
  • 支持第三方组件
  • 编辑器集成
  • 友好的用户界面

安装

npm install click2component -D
# 或
yarn add click2component -D

使用方法

Vue 3

import { createApp } from "vue";
import Click2Component from "click2component";

const app = createApp(App);
app.use(Click2Component);
app.mount("#app");

Vue 2

import Vue from "vue";
import Click2Component from "click2component";

Vue.use(Click2Component);

配置选项

app.use(Click2Component, {
  enabled: true, // 启用/禁用插件
  key: "Alt", // 触发键 (Alt/Shift/Control/Meta)
  defaultEditor: "vscode", // 默认编辑器
});

使用说明

  1. 按住 Alt 键(或您配置的按键)
  2. 鼠标悬停在组件上可以看到文件路径
  3. 点击即可在编辑器中打开组件

特殊功能

  • 第三方组件导航:支持跳转到 node_modules 源代码
  • 精确行号检测:准确定位文本内容和元素
  • 文件路径显示:悬停时在左上角显示组件文件路径

支持的编辑器

  • VS Code (vscode://file)
  • Cursor (cursor://file)
  • Trae (trae://file)

重要说明

  • 项目中必须启用 Source Map
  • 编辑器必须支持 URL 协议打开

调试信息

跳转组件时,控制台会显示:

[Click2Component] 跳转到: {
  file: "path/to/component.vue",
  line: 1
}

Vue CLI 4.x 支持

Click2Component 现在可以自动检测 Vue CLI 4.x 项目的根路径。无需额外配置!插件将:

  1. 自动检测 webpack 环境
  2. 从 Vue CLI 配置中找到正确的项目根路径
  3. 正确解析组件路径以供编辑器导航

只需正常安装和使用即可:

// Vue 3
import { createApp } from "vue";
import Click2Component from "click2component";

const app = createApp(App);
app.use(Click2Component);
app.mount("#app");

// Vue 2
import Vue from "vue";
import Click2Component from "click2component";

Vue.use(Click2Component);

许可证

MIT