
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
node-clipboard-wd
Advanced tools
node-clipboard-wd is an experimental clipboard accessor that uses the Devtools protocol via puppeteer to extract data from the clipboard.
The Clipboard class exposes the following API:
interface Paster {
getClipboardTypes(): Promise<string[]>;
getClipboardRichText(): Promise<string>;
getClipboardPlainText(): Promise<string>;
getClipboardFile(): Promise<number[]>;
getClipboardFormat(format: string): Promise<number[]>;
}
node-clipboard-wd functions by setting up a paste listener in a Chromium instance and sending CTRL+V to trigger a paste operation.
The listener intercepts the pasted data and returns it to the Node process. This approach works surprisingly well.
The original intent was to leverage Chrome's clipboard API for both copying and pasting.
Sadly, the clipboard API is too restrictive to be effective in this context. For example, minimizing the Window that is spawned (headless mode cannot access the clipboard) will prevent all clipboard access.
Copying plain text and rich text is technically possible, but there are no plans to implement it as long as full parity between copying and pasting is impossible to achieve.
While it should be reliable on all operating systems that Chromium runs on, I offer no guarantees.
This project is very experimental.
FAQs
Experimental WebDriver-based clipboard access
The npm package node-clipboard-wd receives a total of 0 weekly downloads. As such, node-clipboard-wd popularity was classified as not popular.
We found that node-clipboard-wd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.