watchclipboard
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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`)
  1. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i watchclipboard

Weekly Downloads

1

Version

1.0.5

License

LGPL-3.0-or-later

Unpacked Size

6.07 kB

Total Files

7

Last publish

Collaborators

  • anusviolin