Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sudhakar3697/node-clipboard-event
Clipboard change event for Node.js/Electron.js/NW.js
https://github.com/sudhakar3697/node-clipboard-event
clipboard clipboard-change clipboard-event electron nodejs nwjs
Last synced: 8 days ago
JSON representation
Clipboard change event for Node.js/Electron.js/NW.js
- Host: GitHub
- URL: https://github.com/sudhakar3697/node-clipboard-event
- Owner: sudhakar3697
- License: mit
- Created: 2020-04-07T11:31:46.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T00:17:44.000Z (12 months ago)
- Last Synced: 2025-01-15T23:08:33.944Z (15 days ago)
- Topics: clipboard, clipboard-change, clipboard-event, electron, nodejs, nwjs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/clipboard-event
- Size: 55.7 KB
- Stars: 102
- Watchers: 2
- Forks: 19
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# node-clipboard-event
Clipboard change event for Node.js, Electron.js, NW.js. **[It's not being polled. This implementation is based on child_process. A native node module using N-API is being developed.](https://github.com/sudhakar3697/node-clipboard-event/tree/v2)**## Motivation
The motivation for creating this open project was these:**1.** [Add Clipboard change event to clipboard API](https://github.com/electron/electron/issues/2280)
**2.** [Clipboard-master](https://github.com/DoumanAsh/clipboard-master)
**3.** [Discussion: feasibility for clipboard change events](https://github.com/aweinstock314/rust-clipboard/issues/48)
## Usage
```js
import ClipboardListener from 'EventClipboard'// In case of CommonJS
// const ClipboardListener = require('ClipboardEvent');// To start listening
ClipboardListener.startListening();ClipboardListener.on('change', () => {
console.log('Clipboard changed');
});// To stop listening
ClipboardListener.stopListening();
```- Access `node_modules/clipboard-event/plataform` and run the following command to give execution permission for files from your OS:
```bash
chmod +x
```## Credits
#### MAC
* [apple/NSPasteboard](https://developer.apple.com/documentation/appkit/nspasteboard?language=occ)
* [alecjacobson/Accessing clipboard (copy paste) from C++ program on Mac OS X](http://www.alecjacobson.com/weblog/?p=2376)
* [Daemon-Devarshi/PasteboardWatcher.swift](https://gist.github.com/Daemon-Devarshi/13efd24f027a775ee862)
#### Linux:
* [stackoverflow/X11 Wait for and Get Clipboard Text](https://stackoverflow.com/a/44992967)#### Windows
* [glombard/ClipboardNotification.cs](https://gist.github.com/glombard/7986317)
* [stackoverflow/"Current thread must be set to single thread apartment (STA)" error in copy string to clipboard](https://stackoverflow.com/questions/17762037/error-while-trying-to-copy-string-to-clipboard)