cross-platform Deno library for writing and reading clipboard.

Overview

deno-clippy

deno-clippy logo

This is cross-platform Deno library for writing and reading clipboard.
You can read from/write image and text.

This library uses Rust's arboard through FFI.
Therefore, it is basically not necessary to prepare some external commands when using this library.

However, if arboard returns an error, deno-clippy will fall back and use an external command (for example, xclip on Linux).
If arboard does not work properly and an error occurs, installing the external command may work.

Known issue.

Currently, arboard is not work on Linux.
So, please install xclip when you using library on Linux.

Example

import * as clippy from "https://deno.land/x/clippy/mod.ts";
import { readAll } from "https://deno.land/[email protected]/streams/conversion.ts";

// write image to clipboard
const f = await Deno.open("testdata/out.png");
await clippy.write_image(f);
f.close();

// read image from clipboard
const r = await clippy.read_image();
const data = await readAll(r);

// write text to clipboard
await clippy.write_text("hello clippy");

// read text from clipboard
const text = await clippy.read_text();

Contribution

Any contribution including documentations are welcome.

Development

To develop this library, the following must be installed.

  • Rust
  • Deno(v1.24.3 or earlier)
  • deno_bindgen
  • xclip(on Linux)
  • make

If you modify the Rust code (under src/), you need to generate bindings/bindings.ts using deno_bindgen(just run make build).
bindings.ts is the glue code to handle dylib from Deno, and basically should not be edited and committed.
bindings.ts will only be changed for new releases as follows.

 const url = new URL(
-  "https://github.com/skanehira/deno-clippy/releases/download/v0.0.1/",
+  "https://github.com/skanehira/deno-clippy/releases/download/v0.1.0/",
   import.meta.url,
 )
 let uri = url.toString()

After implementation is complete, be sure to write tests as well.
The tests are to ensure the quality of this library.

The following is how to run the test.

# clean up dylib cache, and generate bindings.ts, dylib and run deno's test.
$ make deno-test
# run rust's tests.
$ make ffi-test
# run deno-test and ffi-test
$ make test

Author

skanehira

The logo was designed by @hashrock, licensed under CC BY-NC-ND 4.0.

Comments
Owner
skanehira
Like Vim, Go. Many CLI/TUI Tools, Vim plugins author.
skanehira
AdsPower supports Local API, which has functions like reading and writing account configuration information, opening and closing browsers, searching for accounts.

AdsPower supports Local API, which has functions like reading and writing account configuration information, opening and closing browsers, searching for accounts. Besides, it can cooperate with Selenium and Puppeteer to execute browser operations automatically.

AdsPower Official 20 Dec 1, 2022
Opinionated collection of TypeScript definitions and utilities for Deno and Deno Deploy. With complete types for Deno/NPM/TS config files, constructed from official JSON schemas.

Schemas Note: You can also import any type from the default module, ./mod.ts deno.json import { type DenoJson } from "https://deno.land/x/[email protected]

deno911 2 Oct 12, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A cross-platform systray library for Deno.

deno-systray A cross-platform systray library for Deno using the go systray library. Usage import SysTray from "https://deno.land/x/systray/mod.ts";

Robert Soriano 10 Jul 16, 2022
Cross platform shell tools for Deno inspired by zx.

dax Note: This is very early stages. Just started working on it. Cross platform shell tools for Deno inspired by zx. Differences: No globals or global

David Sherret 150 Dec 31, 2022
Cross platform shell tools for Deno inspired by zx.

dax Note: This is very early stages. Just started working on it. Cross platform shell tools for Deno inspired by zx. Differences: No globals or global

David Sherret 45 Jul 24, 2022
GetOsLocalesCrossPlatform - A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers

getOsLocalesCrossPlatform A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers This script is

null 1 Jan 2, 2022
A small, but powerful HTTP library for Deno & Deno Deploy, built for convenience and simplicity

Wren Wren is a small, but powerful HTTP library for Deno & Deno Deploy, built for convenience and simplicity. convenient aliases for HTTP responses au

Jakub Neander 69 Dec 12, 2022
Lightweight library to copy PNG and JPG images to clipboard

Copy Image Clipboard Created with ❤️ by Luan Eduardo da Costa | Follow me on Linkedin ?? About This library allows you to copy JPG and PNG images (onl

Luan Eduardo da Costa 34 Nov 29, 2022
🛣️ A tiny and fast http request router designed for use with deno and deno deploy

Rutt Rutt is a tiny http router designed for use with deno and deno deploy. It is written in about 200 lines of code and is pretty fast, using an exte

Denosaurs 26 Dec 10, 2022
A tool for collecting data and access camera, microphone and location and clipboard via link.

Snow Build malicious links. A tool for collecting data and access camera, microphone and location and clipboard via link.

Msf 14 Dec 12, 2022
A Virtual Interactive Keyboard which replicates every key you press and a Text-Area in which everything is written and can be copied to the clipboard with a click of a button.

A Virtual Interactive Keyboard which replicates every key you press and a Text-Area in which everything is written and can be copied to the clipboard with a click of a button.

Devang Joshi 1 Mar 1, 2021
blog with angular made in sass and firebase auth with google, facebook and github also you can copy to clipboard

BlogAngular This project was generated with Angular CLI version 14.1.2. Development server Run ng serve for a dev server. Navigate to http://localhost

John Gualteros 1 Oct 2, 2022
Webview is a tiny cross-platform library to make web-based GUIs for desktop applications.

webview_deno deno bindings for webview Webview is a tiny cross-platform library to make web-based GUIs for desktop applications. ⚠️ This project is st

webview 1.2k Jan 2, 2023
This is a simple boilerplate for a Deno website, deployed with Deno Deploy.

Simple Deno Website Boilerplate This is a simple website boilerplate built using Deno and deployed using Deno Deploy. Demo at simple-deno-website-boil

Bruno Bernardino 15 Dec 3, 2022
TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy

Atlas SDK atlas_sdk is a TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy Links Docs Import Replace LATEST_VERSION with current latest versi

Erfan Safari 20 Dec 26, 2022
Deno bindings for yoga, using Deno FFI.

deno_yoga Deno bindings for yoga, using Deno FFI. Usage flags: --allow-ffi: Requires ffi access to "yogacore.dll", "libyogacore.so", "libyogacore.dyli

迷渡 6 Feb 11, 2022