simple mac clipboard for node & electron
$ npm i -S simple-mac-clipboard
https://github.com/electron/electron/issues/9035
based on https://developer.apple.com/documentation/appkit/nspasteboard
const clip = require('simple-mac-clipboard')
- for read & write, format is required, and format is always the first argument
- for write, the boolean return value is for success or not, map from objc
YES
orNO
export function clear(): void
clear the clipboard
export function readBuffer(format: string): Buffer
export function writeBuffer(format: string, data: Buffer): boolean
read or write Buffer
from/to the clipboard
export function readText(format: string): string
export function writeText(format: string, text: string): boolean
read or write text from/to the clipboard
the MIT License http://magicdawn.mit-license.org