clipboard
Perform copy and paste operations on the system clipboard.
Methods
clear()
Clear the clipboard content.
has(format)
Check if the current clipboard content contains the specified format.
format
string - Specified formatReturns boolean - Whether it contains the specified format
writeText(text)
Write text
as plain text to the clipboard.
text
string - Text to be written
readText()
Get the plain text content of the current clipboard.
Returns string
writeBuffer(format, buffer)
Write buffer
as format
type to the clipboard.
format
string - Clipboard formatbuffer
Buffer - Buffer format of the content to be written
readBuffer(format)
Read format
type content from the clipboard.
Returns Buffer
writeImage(image)
Write image
to the clipboard.
image
NativeImage - Image to be written to the clipboard
readImage()
Read image format content from the clipboard.
Returns NativeImage
writeHTML(markup)
Write markup
as HTML format to the clipboard.
markup
string
readHTML()
Read HTML format content from the clipboard.
Returns string
copyFiles(paths)
Copy the specified files to the clipboard, supporting paste in file manager.
paths
strings[] - Files to be copied to the clipboard.
Last updated