Clipboard reactive to changes for Node.
Detects when the clipboard changes, regardless of the type of content. It does this by wrapping pbcopy / pbpaste (for OSX), xclip (for Linux and OpenBSD), and clip (for Windows).
Require Node v7 o later
npm
npm i rxclipboard -S
yarn
yarn add rxclipboard
const rxclipboard = require('rxclipboard')
const log = console.log
rxclipboard.watchClipboard().subscribe(
x => log('onNext: %s', x),
e => log('onError: %s', e),
() => log('onCompleted'))
Import using babel
import * as rxclipboard from "rxclipboard"
rxclipboard.watchClipboard( /* { options } */)
// Example
rxclipboard.watchClipboard({ watch: 200 })
Option | Description | Default |
---|---|---|
watch | Modify the change verification time (ms) | 200 |
License MIT Julian David - 2017