### Install @teddyzhu/clipboard Source: https://github.com/teddy-zhu/node-clipboard-rs/blob/main/README.md Installs the @teddyzhu/clipboard package using npm. This is the first step to integrate clipboard functionality into your Node.js project. ```bash npm install @teddyzhu/clipboard ``` -------------------------------- ### Watch clipboard changes with ClipboardListener Source: https://github.com/teddy-zhu/node-clipboard-rs/blob/main/README.md Shows how to use the ClipboardListener class to monitor changes in the system clipboard. The provided callback function will be executed whenever the clipboard content changes. ```javascript const { ClipboardListener } = require('@teddyzhu/clipboard') const listener = new ClipboardListener() listener.watch((text) => { console.log('剪贴板内容变化:', text) }) // stop listen listener.stop() ``` -------------------------------- ### Use ClipboardManager to set/get text Source: https://github.com/teddy-zhu/node-clipboard-rs/blob/main/README.md Demonstrates how to use the ClipboardManager class to interact with the system clipboard. You can set text to the clipboard and retrieve the current text from it. ```javascript const { ClipboardManager } = require('@teddyzhu/clipboard') const clipboard = new ClipboardManager() clipboard.setText('Hello World!') console.log(clipboard.getText()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.