clipboard-rs
v0.0.9
Published
Node binding for rust [clipboard-rs] lib, powered by [napi-rs].
Downloads
3
Readme
Clipboard-RS
Node binding for rust clipboard-rs lib, powered by napi-rs.
Support read/write text/image/filePath to clipboard, cross-platform.
Usage
npm i clipboard-rs
# or
yarn i clipboard-rs
# or
pnpm i clipboard-rs
Usage
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