# dom-open-code

> click dom open and navigate to the code

Latest version **1.0.7** (published 2024-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install dom-open-code
pnpm add dom-open-code
yarn add dom-open-code
bun add dom-open-code
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2024-05-10 |
| First published | 2024-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 56.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | h172144754 |
| Keywords | dom, code, vite, vite-plugin, vue |

## Links

- npm: https://www.npmjs.com/package/dom-open-code
- npm.io page: https://npm.io/package/dom-open-code

## Dependencies (10)

- [unbuild](https://npm.io/package/unbuild.md) ^2.0.0
- [unplugin](https://npm.io/package/unplugin.md) ^1.10.1
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.24.5
- [magic-string](https://npm.io/package/magic-string.md) ^0.30.10
- [launch-editor](https://npm.io/package/launch-editor.md) ^2.6.1
- [@vue/compiler-dom](https://npm.io/package/@vue/compiler-dom.md) ^3.4.27
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^5.1.0
- [@vue/babel-plugin-jsx](https://npm.io/package/@vue/babel-plugin-jsx.md) ^1.2.2
- [@babel/plugin-syntax-import-meta](https://npm.io/package/@babel/plugin-syntax-import-meta.md) ^7.10.4
- [@babel/plugin-transform-typescript](https://npm.io/package/@babel/plugin-transform-typescript.md) ^7.24.5

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2024-05-10
- 1.0.6 — 2024-05-09
- 1.0.5 — 2024-05-09
- 1.0.4 — 2024-05-09
- 1.0.3 — 2024-05-09
- 1.0.2 — 2024-05-09
- 1.0.1 — 2024-05-09
- 1.0.0 — 2024-05-09

## README

<div align="center">
  <div align="center">
    <h1>DOM OPEN CODE</h1>
    <p>点击 dom 直接跳到编辑器对应代码。</p>
    <p>支持 vite/webpack + vue2/vue3 + vscode/websopenrm </p>
  </div>
</div>
## 📦 安装

```bash
npm i dom-open-code
```

## 🔨 使用

#### 第一步

首先在项目入口文件（ `main` 文件）中引入插件初始化

```ts
import { initDomOpenCode } from "dom-open-code";

// 初始化 dom-open-code
// initDomOpenCode()

// 推荐：只在非生产环境初始化
process.env.NODE_ENV !== "production" && initDomOpenCode();
```

#### 第二步

```ts
// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { domOpenCodePlugin } from "dom-open-code/vite";

export default defineConfig({
  plugins: [
    vue(),
    domOpenCodePlugin({}),
  ],
});
```

## 💡 注意

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

```bash
code -v
```

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

---
_Source: https://npm.io/package/dom-open-code · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
