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

vuepress-plugin-copy-page

v1.3.0-RC.1

Published

A VuePress 2 plugin that adds a Copy Page button to copy page content as Markdown. Perfect for sharing documentation with ChatGPT, Claude, and other AI/LLM tools.

Readme

vuepress-plugin-copy-page

English | 中文

一个 VuePress 2 插件,在文档页面上添加"复制页面"按钮,允许用户以原始 Markdown 格式复制页面内容。非常适合与 ChatGPT、Claude 等 AI 工具分享文档。

npm version GitHub tag Publish Status license downloads

功能特性

  • 复制或查看页面的原始 Markdown 内容
  • 页面标题旁的浮动下拉组件
  • 通过路径前缀控制按钮显示/隐藏
  • 深色模式支持
  • 自定义复制模板(URL、时间戳或自定义函数)
  • 内置国际化(en-US、zh-CN)

安装

npm install vuepress-plugin-copy-page
# 或: pnpm add / yarn add / bun add

快速开始

// .vuepress/config.ts
import { defineUserConfig } from 'vuepress'
import { copyPagePlugin } from 'vuepress-plugin-copy-page'

export default defineUserConfig({
  plugins: [
    copyPagePlugin({
      includes: ['/posts/', '/docs/'],
      excludes: ['/about/'],
      copyTemplate: 'withUrl'
    })
  ]
})
// .vuepress/client.ts
import { defineClientConfig } from 'vuepress/client'
import 'vuepress-plugin-copy-page/styles/index.scss'

export default defineClientConfig({})

选项

| 选项 | 类型 | 默认值 | 描述 | |------|------|--------|------| | includes | string[] | ['/posts/'] | 显示按钮的路径前缀 | | excludes | string[] | [] | 不显示按钮的路径前缀 | | urlPrefix | string | 'https://vuepress-plugin-copy-page.zhaofutao.cn' | 复制内容中的 URL 前缀 | | copyTemplate | 'default' \| 'withUrl' \| 'withTimestamp' \| 'full' \| function | 'default' | 复制内容格式模板 | | i18n | Record<string, CopyPageI18n> | 内置 en-US/zh-CN | 按语言配置国际化文本 |

复制模板

| 模板 | 描述 | |------|------| | 'default' | 仅 Markdown 内容 | | 'withUrl' | 在开头添加来源 URL | | 'withTimestamp' | 在开头添加复制时间戳 | | 'full' | 标题 + URL + 时间戳 | | (content, meta) => string | 自定义函数 |

meta 对象:{ path, url, title, timestamp }

国际化

内置 en-USzh-CN,自动识别页面语言。添加其他语言:

copyPagePlugin({
  i18n: {
    'ja-JP': {
      copyPage: 'ページをコピー',
      copied: 'コピーしました!',
      copyFailed: 'コピー失敗',
      copiedToClipboard: 'クリップボードにコピーしました!',
      copyAsMarkdown: 'Markdownとしてコピー',
      viewAsMarkdown: 'Markdownを表示',
      viewAsMarkdownDesc: '新しいタブでページコンテンツを開く'
    }
  }
})

兼容性

  • VuePress >=2.0.0-rc.0 | Vue ^3.0.0
  • 浏览器: Chrome 66+, Firefox 63+, Safari 13.1+(需要 HTTPS 或 localhost)

更新日志

v1.3.0

  • 破坏性变更: 移除 positionstyleMode 配置选项
  • 修复事件监听器内存泄漏
  • 修复 XSS 风险:使用 textContent 替代 innerHTML
  • 修复路由切换时的竞态条件
  • 测试覆盖率提升到 94%

v1.2.0

  • 添加 URL 前缀、复制模板、国际化选项

v1.1.5

  • 优化按钮样式

v1.0.2

  • 修复多主题 h1 选择器

v1.0.1

  • 初始版本

许可证

MIT

链接