1.0.5 • Published 4 years ago

watchclipboard v1.0.5

Weekly downloads
6
License
LGPL-3.0-or-later
Repository
gitlab
Last release
4 years ago

watchClipboard

A module that uses Electron's Clipboard API to watch the clipboard

Should work using raw node.js but idk its just a module i quickly put together

Installation

From NPM

npm i watchclipboard

From Source

Note that this method requires TypeScript installed, although it is a dependency, so it should install it anyway

git clone https://gitlab.com/0J3/watchclipboard.js.git
cd watchclipboard.js.git
npm install
npm run build

Usage

  1. Load the module using
    const clipboard = require(`watchclipboard`)

    (or)

    const {
       watchChanges
       unWatchChanges
    } = require(`watchclipboard`)
  2. Start watching clipboard changes using
    clipboard.watchChanges((clipboardText: string)=>{
       // code here
    })

    remove :string for it to work in js. this example is for typescript

Notice

Since this uses an interval to check for changes, expect higher cpu usage and minor delays from when the clipboard changes, to when the event fires. If the callback errors, it will likely spam the console.

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago