copy-paste
Version:
A command line utility that allows read/write (i.e copy/paste) access to the system clipboard.
10 lines (8 loc) • 367 B
JavaScript
exports.copy = { command: "termux-clipboard-set", args: [] };
exports.paste = { command: "termux-clipboard-get", args: [] };
exports.paste.full_command = exports.paste.command;
exports.encode = (str) => Buffer.from(str, "utf8");
exports.decode = (chunks) => {
const data = Array.isArray(chunks) ? chunks : [chunks];
return Buffer.concat(data).toString("utf8");
};