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

tauri-plugin-clipboard-next-api

v0.2.4

Published

Tauri 2 clipboard plugin - read/write/listen to clipboard (text/rtf/html/image/files) across Windows, macOS, Linux and iOS.

Readme

tauri-plugin-clipboard-next

Crates.io npm License

Tauri 2 剪贴板插件:在 Windows/macOS/Linux/iOS 上读取/写入/监听剪贴板(纯文本/富文本/HTML/图片/文件)。

English | 简体中文

功能支持

  • 纯文本
  • Html
  • 富文本
  • 图片(PNG 格式)
  • 文件(file-uri-list 格式)
  • 监听剪贴板变化

平台支持

| 平台 | 支持情况 | |----------|------| | Windows | ✅ | | macOS | ✅ | | Linux | ✅ | | iOS(测试版) | ✅ | | Android | 🚧 |

安装

cargo add tauri-plugin-clipboard-next

您可以使用您喜欢的 JavaScript 包管理器安装 JavaScript Guest 绑定:

pnpm add tauri-plugin-clipboard-next-api

使用方法

src-tauri/src/lib.rs

pub fn run() {
    tauri::Builder::default()
+       .plugin(tauri_plugin_clipboard_next::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

src-tauri/capabilities/default.json

{
    ...
    "permissions": [
        ...
+       "clipboard-next:default"
    ]
}

之后,所有插件的 API 都可以通过 JavaScript guest 绑定使用:

import { startWatch, onClipboardChange } from 'tauri-plugin-clipboard-next-api';

await startWatch();

const unlisten = await onClipboardChange((clipboard) => {
  console.log('Clipboard changed:', clipboard);
});

// 稍后,停止监听
unlisten();

方法

| 方法 | 描述 | |---------------------|--------------------------------------------------| | startWatch | Start listening for clipboard changes | | stopWatch | Stop listening for clipboard changes | | hasText | Check if the clipboard contains plain text | | hasRtf | Check if the clipboard contains rich text | | hasHtml | Check if the clipboard contains html | | hasImage | Check if the clipboard contains an image | | hasFiles | Check if the clipboard contains files | | readText | Read plain text from the clipboard | | readRtf | Read rich text from the clipboard | | readHtml | Read html from the clipboard | | readImage | Read image from the clipboard | | readFiles | Read file paths from the clipboard | | writeText | Write plain text to the clipboard | | writeRtf | Write rich text to the clipboard | | writeHtml | Write html content to the clipboard | | writeImage | Write an image to the clipboard from a file path | | writeFiles | Write file paths to the clipboard | | clear | Clear the clipboard contents | | getFilePath | Get the file path for clipboard operations | | readClipboard | Read all available content from the clipboard | | onClipboardChange | Listen for clipboard changes |

示例

git clone https://github.com/zhoushi1/tauri-plugin-clipboard-next.git
pnpm install

pnpm build

cd examples/tauri-app

pnpm install

pnpm tauri dev

致谢

  • 特别感谢 clipboard-rs crate,它为这个 Tauri 2 插件提供了可靠的跨平台剪贴板操作能力(支持纯文本、富文本、HTML、图片和文件)。