Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clipboardy

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clipboardy - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

lib/termux.js

22

index.js
'use strict';
const path = require('path');
const execa = require('execa');
const termux = require('./lib/termux.js');
const handler = err => {
if (err.code === 'ENOENT') {
throw new Error('Couldn\'t find the required `xsel` binary. On Debian/Ubuntu you can install it with: sudo apt install xsel');
let message = 'Couldn\'t find the required `xsel` binary. On Debian/Ubuntu you can install it with: sudo apt install xsel';
if (err.path === 'termux-clipboard-get' || err.path === 'termux-clipboard-set') {
message = 'Couldn\'t find the termux-api scripts. You can install them with: apt install termux-api';
}
throw new Error(message);
}

@@ -14,6 +19,6 @@

const darwin = {
copy: opts => execa('pbcopy', [], opts),
paste: opts => execa.stdout('pbpaste', [], opts),
copySync: opts => execa.sync('pbcopy', [], opts),
pasteSync: opts => execa.sync('pbpaste', [], opts)
copy: opts => execa('pbcopy', opts),
paste: opts => execa.stdout('pbpaste', opts),
copySync: opts => execa.sync('pbcopy', opts),
pasteSync: opts => execa.sync('pbpaste', opts)
};

@@ -26,3 +31,3 @@

paste: opts => execa.stdout('cscript', ['/Nologo', winBinPath], opts),
copySync: opts => execa.sync('clip', [], opts),
copySync: opts => execa.sync('clip', opts),
pasteSync: opts => execa.sync('cscript', ['/Nologo', winBinPath], opts)

@@ -74,2 +79,7 @@ };

return win32;
case 'android':
if (process.env.PREFIX !== '/data/data/com.termux/files/usr') {
throw new Error('You need to install Termux for this module to work on Android: https://termux.com');
}
return termux(handler);
default:

@@ -76,0 +86,0 @@ return linux;

{
"name": "clipboardy",
"version": "1.0.2",
"version": "1.1.0",
"description": "Access the system clipboard (copy/paste)",

@@ -20,2 +20,3 @@ "license": "MIT",

"index.js",
"lib",
"fallbacks",

@@ -22,0 +23,0 @@ "vendor"

@@ -5,3 +5,3 @@ # clipboardy [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/clipboardy.svg?branch=master)](https://travis-ci.org/sindresorhus/clipboardy) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/gflt3gjn1ia0a3vo/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/clipboardy/branch/master)

Cross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD.
Cross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD, Android with [Termux](https://termux.com/).

@@ -8,0 +8,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc