🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

general-clipboard-listener

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

general-clipboard-listener

Cross Platform Clipboard listener that detects both text and image update in clipboard

unpublished
latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

This project is moved to CrossCopy. https://github.com/CrossCopy/clipboard

This repo will be not be maintained and will be archived.

New NPM Package: https://www.npmjs.com/package/@crosscopy/clipboard

General Clipboard Listener

A Cross-Platform clipboard listener that listens for both text and image (screenshots).

npm package: https://www.npmjs.com/package/general-clipboard-listener

Installation

npm i general-clipboard-listener

Usage

It has a very easy to use event-based system.

See demo.ts for a demo.

Run ts-node demo.ts.

import clipboardEventListener from "./index";

clipboardEventListener.on("text", () => {
  console.log("Clipboard Text Updated");
});

clipboardEventListener.on("image", () => {
  console.log("Clipboard Image Updated");
});

clipboardEventListener.on("open", (data) => {
  console.log(data);
});

clipboardEventListener.startListening();

setTimeout(() => {
  clipboardEventListener.stopListening();
}, 10000);

Explanation

It's achieved using child process + stdout.

I took a golang version of the listener from golang-design/clipboard.

When a change is detected, IMAGE_CHANGED or TEXT_CHANGED is printed to stdout.

This library runs compiled go-version clipboard listener using child process and listen to the stdout.

If it sees the keywords in child process's stdout, an event will be emitted.

Run npm run demo to see a demo for 10 sec. Once started, copy some text and screenshot and check the terminal.

Supported Platforms

Format: process.platform/process.arch

The process here is from nodejs.

Supported platforms can be found in go-clipboard-monitor.

If your nodejs gives different platform or arch, it may not work.

Keywords

clipboard

FAQs

Package last updated on 31 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts