simple-mac-clipboard
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

simple-mac-clipboard

simple mac clipboard for node & electron

npm version npm downloads npm license

Install

$ npm i -S simple-mac-clipboard

Related

https://github.com/electron/electron/issues/9035

API

based on https://developer.apple.com/documentation/appkit/nspasteboard

const clip = require('simple-mac-clipboard')

Note

  • 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 or NO

clear

export function clear(): void

clear the clipboard

readBuffer & writeBuffer

export function readBuffer(format: string): Buffer
export function writeBuffer(format: string, data: Buffer): boolean

read or write Buffer from/to the clipboard

readText & writeText

export function readText(format: string): string
export function writeText(format: string, text: string): boolean

read or write text from/to the clipboard

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

Package Sidebar

Install

npm i simple-mac-clipboard

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

11.7 kB

Total Files

9

Last publish

Collaborators

  • magicdawn