deno_copy_paste
Copy/paste functionality for Deno. Compatible with macOS, Windows and Linux.
Usage
Prerequisites
Scripts must be run with the
--allow-run
permission.For Linux,
xsel
must first be installed.
sudo apt-get install xsel
Text
import { readText, writeText } from "https://deno.land/x/copy_paste/mod.ts";
const text = "Is you ain't?";
await writeText(text); // Writes/copies text to the system clipboard.
const textCopy = await readText(); // Reads/pastes text from the system clipboard.
Raw data
import { read, write } from "https://deno.land/x/copy_paste/mod.ts";
const file = await Deno.readFile("image.png");
await write(file); // Writes/copies raw data to the system clipboard.
const fileCopy = await read(); // Reads/pastes raw data from the system clipboard.
Documentation
Check out the documentation here.
Testing
deno task test
Related
clipboard - Simple clipboard api for text