1 | # clipboardy [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/clipboardy.svg?branch=master)](https://travis-ci.org/sindresorhus/clipboardy) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/gflt3gjn1ia0a3vo/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/clipboardy/branch/master)
|
2 |
|
3 | > Access the system clipboard (copy/paste)
|
4 |
|
5 | Cross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD, Android with [Termux](https://termux.com/).
|
6 |
|
7 |
|
8 | ## Install
|
9 |
|
10 | ```
|
11 | $ npm install clipboardy
|
12 | ```
|
13 |
|
14 |
|
15 | ## Usage
|
16 |
|
17 | ```js
|
18 | const clipboardy = require('clipboardy');
|
19 |
|
20 | clipboardy.writeSync('🦄');
|
21 |
|
22 | clipboardy.readSync();
|
23 | //=> '🦄'
|
24 | ```
|
25 |
|
26 |
|
27 | ## API
|
28 |
|
29 | ### clipboardy
|
30 |
|
31 | #### .write(input)
|
32 |
|
33 | Write (copy) to the clipboard asynchronously. Returns a `Promise`.
|
34 |
|
35 | ##### input
|
36 |
|
37 | Type: `string`
|
38 |
|
39 | #### .read()
|
40 |
|
41 | Read (paste) from the clipboard asynchronously. Returns a `Promise`.
|
42 |
|
43 | #### .writeSync(input)
|
44 |
|
45 | Write (copy) to the clipboard synchronously.
|
46 |
|
47 | ##### input
|
48 |
|
49 | Type: `string`
|
50 |
|
51 | #### .readSync()
|
52 |
|
53 | Read (paste) from the clipboard synchronously.
|
54 |
|
55 |
|
56 | ## Related
|
57 |
|
58 | - [clipboard-cli](https://github.com/sindresorhus/clipboard-cli) - CLI for this module
|
59 | - [copy-text-to-clipboard](https://github.com/sindresorhus/copy-text-to-clipboard) - Copy text to the clipboard in the browser
|
60 |
|
61 |
|
62 | ## License
|
63 |
|
64 | MIT © [Sindre Sorhus](https://sindresorhus.com)
|