npm.io
0.2.0 • Published 7 years ago

node-electron-clipboard

Licence
MIT
Version
0.2.0
Deps
7
Size
270 kB
Vulns
47
Weekly
0

node-electron-clipboard

Use electron's clipboard api under the hood to bring cross platform writeText and writeImage to node.js

API

type imgType = 'PNG' | 'JPEG'
interface Clipboard {
  writeText(text: string): Promise<boolean>
  writeImage(path: string): Promise<boolean>
  writeImage(img: Buffer): Promise<boolean>
  readText(): Promise<string>
  readImage(type?: imgType): Promise<Buffer> // Use PNG if type is not provided
  clear(type: string): Promise<boolean>
  close(): void
}
type initClipboard = () => Promise<Clipboard>
declare const init: initClipboard
export = init