node-electron-clipboard

0.2.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i node-electron-clipboard

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

276 kB

Total Files

11

Last publish

Collaborators

  • maple3142