
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
clipboardy
Advanced tools
Access the system clipboard (copy/paste)
Cross-platform. Supports: macOS, Windows, Linux (including Wayland), OpenBSD, FreeBSD, Android with Termux, and modern browsers.
npm install clipboardy
import clipboard from 'clipboardy';
await clipboard.write('🦄');
await clipboard.read();
//=> '🦄'
// Or use the synchronous API
clipboard.writeSync('🦄');
clipboard.readSync();
//=> '🦄'
Browser usage: Requires a secure context (HTTPS). Synchronous methods are not available in browsers.
Write (copy) to the clipboard asynchronously.
Returns a Promise<void>.
Type: string
The text to write to the clipboard.
await clipboard.write('🦄');
Read (paste) from the clipboard asynchronously.
Returns a Promise<string>.
const content = await clipboard.read();
//=> '🦄'
Write (copy) to the clipboard synchronously.
Doesn't work in browsers.
Type: string
The text to write to the clipboard.
clipboard.writeSync('🦄');
Read (paste) from the clipboard synchronously.
Returns a string.
Doesn't work in browsers.
const content = clipboard.readSync();
//=> '🦄'
Write (copy) images to the clipboard asynchronously.
Returns a Promise<void>.
Only supported on macOS. On other platforms, this is a no-op.
Type: string[]
The file paths of the images to write to the clipboard. Supports any image type that macOS supports, including PNG, JPEG, HEIC, WebP, and GIF.
await clipboard.writeImages(['/path/to/image.png']);
Read images from the clipboard asynchronously.
Returns a Promise<string[]> with file paths to temporary PNG files. You are responsible for cleaning up the files.
Only supported on macOS. On other platforms, this returns an empty array.
const filePaths = await clipboard.readImages();
Check if the clipboard contains images.
Returns a Promise<boolean>.
Only supported on macOS. On other platforms, this returns false.
const hasImages = await clipboard.hasImages();
No. Clipboard operations on Linux require a display server (X11 or Wayland). Headless environments like CI servers or Raspberry Pi without a desktop environment do not have a system clipboard.
The Linux binary is just a bundled version of xsel. The source for the Windows binary can be found here.
On Windows, clipboardy first tries the native PowerShell cmdlets (Set-Clipboard/Get-Clipboard) and falls back to the bundled binary if PowerShell is unavailable or restricted.
Yes. On Linux, clipboardy automatically detects Wayland sessions and uses wl-clipboard when available. If not, it gracefully falls back to X11 tools. Also works with WSLg (Windows Subsystem for Linux GUI). Install wl-clipboard using your distribution's package manager.
The 'clipboard' package is a cross-platform clipboard API for the web. It allows for copying and pasting text within web applications but is not suitable for Node.js server-side applications. It differs from clipboardy in that it is designed for use in the browser rather than in Node.js environments.
The 'copy-paste' package is another Node.js module that provides copy and paste functionality. It is similar to clipboardy but has not been maintained as actively. It may not support as many platforms or have as robust error handling as clipboardy.
The 'clipboard-cli' package is a command-line interface for copying and pasting text using the system clipboard. It is built on top of clipboardy and offers a CLI rather than a programmatic API. It is useful for scripting and command-line tasks but not for integrating clipboard functionality into Node.js applications.
FAQs
Access the system clipboard (copy/paste)
The npm package clipboardy receives a total of 6,421,822 weekly downloads. As such, clipboardy popularity was classified as popular.
We found that clipboardy demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.