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

open-editor-file

v0.0.81

Published

Supports both Webpack and Vite out-of-the-box

Readme

open-editor-file

open-editor-file介绍

用于vue(2、3)项目, 通过 鼠标点击页面内容 在编辑器打开内容.vue文件、做到快速定位组件.vue文件、支持市面主流编辑器vscode、 webstorm、sublimeText、idea、phpstorm、等等...、支持开箱即用、常用参数定制化需求!

安装插件

yarn add open-editor-file -D
// 或者
pnpm add open-editor-file -D

使用插件步骤

  • 🎃 在vue.config.js 或者 vite.config.js 加入自定义服务插件
  • 🎃 在main.js添加编辑器打开文件插件

第一步 自定义服务插件

vite构建工具(vite.config.ts)

import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// 引入插件
import { openEditorFileServicePlugin } from "open-editor-file/vite";

export default defineConfig({
  plugins: [
    vue(), 
    // 添加插件注入
    openEditorFileServicePlugin()
  ],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
  server: {
    host: true,
  },
});

webpack构建工具( webpack(3.6 | 4.0)版本 => webpack.dev.conf.js )

const { openEditorFileServicePlugin } = require("open-editor-file/webpack");
const devWebpackConfig = merge(baseWebpackConfig, {
    ...,
    devServer: {
        ...,
        before: openEditorFileServicePlugin(), // 注入插件
        ...
    }
})

第二步 main.js添加编辑器打开文件插件


import { openEditorFilePlugin } from "open-editor-file";

// vite
import.meta.env.DEV && app.use(openEditorFilePlugin());

// webpack
process.env.NODE_ENV === 'development' && Vue.use(openEditorFilePlugin());

编辑器打开文件方式

// 默认快捷键
macos: command + 点击页面内容
windows: ctrl + 点击页面内容

// 自定义快捷键可通过{ keyName: string | Array<string> }
app.use(openEditorFilePlugin({ keyName:'a' });
// 多个
app.use(openEditorFilePlugin({ keyName:['a', 'b'] });

常用配置选项

import { openEditorFilePlugin } from "open-editor-file";
app.use(openEditorFilePlugin({
  keyName: string | Array<string> // 键盘的快捷键配置
  highlight:'xxx' // 高亮的组件颜色和边框颜色 默认-white
  isHighlight:true // 是否开启组件高亮选择   默认-true
});