JSPM

node-clipboardy

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3110
  • Score
    100M100P100Q117965F
  • License MIT

Access the system clipboard (copy/paste). For node only:)

Package Exports

  • node-clipboardy

Readme

node-clipboardy

Access the system clipboard (copy/paste)

Only for node, and original copied source code: https://github.com/sindresorhus/clipboardy

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

Install

npm install node-clipboardy

Usage

var ncp = require('node-clipboardy');

ncp.writeSync('🦄');

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

API

clipboard

.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.