Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-clipboardy

atageldi19422914.4kMIT1.0.3

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

clipboard, copy, paste, copy-paste, pasteboard, read, write, pbcopy, clip, xclip, xsel

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.