
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.
clipboard-image
Advanced tools
Get and set images on the macOS clipboard
npm install clipboard-image
import {
writeClipboardImages,
readClipboardImages
} from 'clipboard-image';
await writeClipboardImages(['screenshot.png', 'photo.jpg']);
console.log(await readClipboardImages());
//=> ['/var/folders/.../clipboard-image-1.png', '/var/folders/.../clipboard-image-2.png']
hasClipboardImages()Check if there are images on the clipboard.
Returns a Promise<boolean>.
On non-macOS platforms, it returns false.
readClipboardImages()Read images from the clipboard.
You get PNG files no matter what image types they were on the clipboard to make it easier to handle.
Returns a Promise<string[]> with paths to the saved PNG files. You are in charge of these files. You can move them somewhere else or clean them up when you are done.
On non-macOS platforms, it returns an empty array.
writeClipboardImages(filePaths)Write images to the clipboard.
Supports any image type that macOS supports, which includes PNG, JPEG, HEIC, WebP, GIF.
On non-macOS platforms, it does nothing.
Type: Array<string | URL>
An array of file paths and file URL objects pointing to image files.
# Read images from clipboard and output file paths
clipboard-image
# Write images to clipboard
clipboard-image image1.png image2.jpg
When reading from clipboard, if there are images, they will be saved to a temporary directory and the file paths will be printed (one per line).
When writing to clipboard, provide one or more image file paths as arguments.
FAQs
Get and set images on the macOS clipboard
The npm package clipboard-image receives a total of 254,977 weekly downloads. As such, clipboard-image popularity was classified as popular.
We found that clipboard-image 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.