Skip to content
PluginStats

dom-to-code weekly downloads statistics

By better-tcy · npm · Webpack plugins

navigate to the code through the dom

View on npm Fresh · Dec 6, 2026

dom-to-code has 46 recorded weekly downloads on npm, a decrease of 34.3% over the past 30 days, ranking #2790 of 3,247 tracked listings.

Weekly downloads
46
Official API · Dec 5, 2026
7-day growth
-11.5%
-6 weekly downloads
30-day growth
-34.3%
-24 weekly downloads
90-day growth
-24.6%
-15 weekly downloads
Rank
#2790
▼ 181 in 7 days

About dom-to-code

<div align="center"> <a href="https://dom-to-code.netlify.app/"> <img src="https://raw.githubusercontent.com/better-tcy/dom-to-code/master/packages/doc/.vuepress/public/images/logo-bg.png" width="50%"> </a> <div align="center"> <h1>DOM TO CODE</h1> <p>简体中文 | <a href="./README_en.md">English</a></p> <p>开发效率神器,点击 dom 直接跳到编辑器对应代码。</p> <p>支持 vite/webpack + vue2/vue3/react + vscode/webstorm </p> </div> <p> <a href="https://www.npmjs.com/package/dom-to-code"><img src="https://img.shields.io/npm/v/dom-to-code.svg" alt="npm package"></a> <a href="#badge"><img src="https://img.shields.io/github/languages/top/better-tcy/dom-to-code" alt="language"></a> <a href="https://img.badgesize.io/https:/unpkg.com/dom-to-code/dist/?label=gzip%20size&compression=gzip"><img src="https://img.badgesize.io/https:/unpkg.com/dom-to-code/dist/?label=gzip%20size&compression=gzip" alt="gzip"></a> <a href="#badge"><img src="https://img.shields.io/librariesio/github/better-tcy/dom-to-code" alt="librariesio"></a> <a href="https://github.com/better-tcy/dom-to-code/blob/master/LICENSE"><img src="https://img.shields.io/github/license/better-tcy/dom-to-code" alt="LICENSE"></a> <img src="https://img.shields.io/github/stars/better-tcy/dom-to-code?style=social" alt="stars"> </p> </div>

✨ 介绍

接手一个项目开发网页时要修改某部分,要么靠搜索,要么靠记忆找到对应代码,过程极为浪费时间。

在项目里用了 dom-to-code 插件后,对准想要修改的 dom 部分 ctrl + 按下鼠标滚轮,就会在编辑器打开对应的 dom 元素源码。

(使用 mac 触摸板的用户可以ctrl + 触摸板右键)

支持 vite/webpack + vue2/vue3/react

支持 vscode/webstorm

别人搜索你直接跳,别人加班你摸鱼。

<img src="https://raw.githubusercontent.com/better-tcy/dom-to-code/master/packages/doc/.vuepress/public/images/dom-to-code-example.gif">

📦 安装

npm i dom-to-code

🔨 使用

配置选项
interface Options {
  /**
   * 插件模式,默认是 vue
   */
  mode: 'vue' | 'react'

  /**
   * 引入的文件规则,vue 默认是 jsx、tsx、vue 文件,react 默认是 jsx、tsx 文件
   */
  include?: string | RegExp | string[] | RegExp[] | null

  /**
   * 排除的文件规则,默认是 node_modules 文件
   */
  exclude?: string | RegExp | string[] | RegExp[] | null
}

第一步

首先在项目入口文件(比如 index 文件或 main 文件)中引入插件初始化

import { initDomToCode } from 'dom-to-code'

// 初始化 dom-to-code
// initDomToCode()

// 推荐:只在非生产环境初始化
process.env.NODE_ENV !== 'production' && initDomToCode()
第二步

配置打包器,dom-to-code 支持 vite 和 webpack 打包器,以下是 vite 、vue-cli、webpack 里的示例(推荐只在非生产环境配置)

<details> <summary>Vite</summary><br>
// vite.config.ts
import { defineConfig } from 'vite'
import vue3 from '@vitejs/plugin-vue'
import { domToCodePlugin } from 'dom-to-code/vite'

export default defineConfig({
  plugins: [
    vue3(),
    domToCodePlugin({
      mode: 'vue'
    })
  ]
})

Example: playgrounds/vite-vue3

<br></details>

<details> <summary>Webpack</summary><br>
// webpack.config.js
const { domToCodePlugin } = require('dom-to-code/webpack')
module.exports = {
  /* ... */
  plugins: [
    domToCodePlugin({
      mode: 'vue'
    })
  ]
}

<br></details>

<details> <summary>Vue CLI</summary><br>
// vue.config.js
const { domToCodePlugin, domToCodeDevServerV4, domToCodeDevServerV5 } = require('dom-to-code/webpack')

module.exports = {
  devServer: {
    // 如果你的 package.json 里的 @vue/cli-service 版本 <= 4.x.x,则使用 domToCodeDevServerV4
    // ...domToCodeDevServerV4,

    // 如果你的 package.json 里的 @vue/cli-service 版本 >= 5.x.x,则使用 domToCodeDevServerV5
    ...domToCodeDevServerV5
  },
  configureWebpack: {
    plugins: [
      domToCodePlugin({
        mode: 'vue'
      })
    ]
  }
  // 如果你使用的是chainWebpack
  // chainWebpack: (config) => {
  //   config
  //     .plugin('domToCodePlugin')
  //     .use(domToCodePlugin())
  // }
}

Example: playgrounds/webpack5-vue2

<br></details>

<details> <summary>Create-react-app + react-app-rewired</summary><br>
// config-overrides.js
const { domToCodePlugin, domToCodeDevServerV4, domToCodeDevServerV5 } = require('dom-to-code/webpack')

module.exports = {
  webpack(config) {
    config.plugins.push(domToCodePlugin({
      mode: 'react',
    }))
    return config
  },
  devServer(configFunction) {
    return function (proxy, allowedHost) {
      const config = configFunction(proxy, allowedHost)

      // 如果你的 package.json 里的 react-scripts 版本 <= 4.x.x,则使用 domToCodeDevServerV4
      // Object.assign(config, domToCodeDevServerV4)

      // 如果你的 package.json 里的 react-scripts 版本 >= 5.x.x,则使用 domToCodeDevServerV5
      Object.assign(config, domToCodeDevServerV5)

      return config
    }
  },
}

Example: playgrounds/webpack5-react

<br></details>

📚 文档

查看 文档指南 📒(即将上线...)

💡 注意

如果无法跳转编辑器,请确保你的编辑器已经添加到环境变量,比如 vscode,添加成功后在命令终端输入

code -v

可以看到 vscode 版本信息意味着成功。

🤖️ Contributing

Learn about contribution here.

This project exists thanks to all the people who contribute:

<a href="https://github.com/better-tcy/dom-to-code/graphs/contributors"> <img src="https://contrib.rocks/image?repo=better-tcy/dom-to-code" /> </a>

📄 License

MIT License © 2022-PRESENT tuocangyu

Description from the npm listing.

  • dom
  • code
  • inspector
  • vite
  • vite-plugin
  • webpack
  • webpack-plugin
  • vue
  • react

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

dom-to-code weekly downloads on npm, last 90 days: 46 weekly downloads as of Dec 5, 2026, -24.6% over 90 days.dom-to-codeWeekly downloads on npm · Last 90 days46downloads / week-24.6% over 90 days020406080100120Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
dom-to-code weekly downloads on npm, last 90 days: 46 weekly downloads as of Dec 5, 2026, -24.6% over 90 days.

7/30/90-day growth

dom-to-code weekly downloads growth on npm: -11.5% over 7 days, -34.3% over 30 days, -24.6% over 90 days.dom-to-codeWeekly downloads growth on npm46downloads / week now7-day growth-6 weekly downloads-11.5%30-day growth-24 weekly downloads-34.3%90-day growth-15 weekly downloads-24.6%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
dom-to-code weekly downloads growth on npm: -11.5% over 7 days, -34.3% over 30 days, -24.6% over 90 days.

Ranking history

dom-to-code npm ranking history: currently #2790 (by weekly downloads).dom-to-codenpm ranking · by weekly downloads · Last 90 days#2790current rank#1800#2000#2200#2400#2600#2800Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 43 observations · Updated Dec 5, 2026pluginstats.com
dom-to-code npm ranking history: currently #2790 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 140, #10 (overall #2,790)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 13, #3 (overall #243)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for dom-to-code
Date (UTC)Weekly downloadsChange vs. previous
46+1
45-1
46-4
50+11
39-10
490
49-3
520
52+3
49-7
56+3
53+14
39+2
37—

Similar npm Webpack plugins plugins

All 20 dom-to-code alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/dom-to-code. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.