Node binding for rust clipboard-rs lib, powered by napi-rs.
Support read/write text/image/filePath to clipboard, cross-platform.
npm i clipboard-rs
# or
yarn i clipboard-rs
# or
pnpm i clipboard-rs
import {
readText,
readFiles,
readImage,
writeText,
writeImage,
writeFiles
} from 'clipboard-rs'
const text = readText() // => string | null
const imageBuffer = readImage() // => Buffer | null
const files = readFiles() // => string[] | null
// return true means write to clipboard successfully
writeText('text content') // => true | null
writeImage(buf) // => true | null
writeFiles([path]) // => true | null
Please check clipboard-rs.