Skip to content

Access the system clipboard (copy/paste)

License

Notifications You must be signed in to change notification settings

stroncium/clipboardy

 
 

Repository files navigation

clipboardy Build Status

Access the system clipboard (copy/paste)

Cross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD, Android with Termux.

Install

$ npm install clipboardy

Usage

const clipboardy = require('clipboardy');

clipboardy.writeSync('🦄');

clipboardy.readSync();
//=> '🦄'

API

clipboardy

.write(text)

Write (copy) to the clipboard asynchronously. Returns a Promise.

text

Type: string

The text to write to the clipboard.

.read()

Read (paste) from the clipboard asynchronously. Returns a Promise.

.writeSync(text)

Write (copy) to the clipboard synchronously.

text

Type: string

The text to write to the clipboard.

.readSync()

Read (paste) from the clipboard synchronously.

Related

License

MIT © Sindre Sorhus

About

Access the system clipboard (copy/paste)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.9%
  • TypeScript 4.1%