Socket
Socket
Sign inDemoInstall

@clevercloud/random-labels

Package Overview
Dependencies
20
Maintainers
11
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "@clevercloud/random-labels",
"version": "1.0.0",
"version": "1.0.1",
"description": "Randomize a list of labels and display them in a suspenseful way",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -5,2 +5,3 @@ #!/usr/bin/env node

import clipboardy from 'clipboardy';
import { spawn } from 'child_process';

@@ -11,6 +12,6 @@ const CLIPBOARD_OPTION = "--clipboard";

const args = process.argv.slice(2);
const shouldCopyToClipboard = args.includes(CLIPBOARD_OPTION);
const labels = args.filter((arg)=>arg !== CLIPBOARD_OPTION );
const labels = args.filter((arg) => arg !== CLIPBOARD_OPTION);
const isWayland = process.env.XDG_SESSION_TYPE === 'wayland';

@@ -43,5 +44,18 @@ function run () {

const randomLabelsMarkdown = randomLabels
.map((name) => `* ${name}`)
.join('\n');
clipboardy.writeSync(randomLabelsMarkdown);
.map((name) => `* ${name}`)
.join('\n');
clipboardy.write(randomLabelsMarkdown)
.catch((error) => {
if (!error.message.includes("Couldn't find the `xsel` binary and fallback didn't work.") || !isWayland) {
console.error(error);
}
});
// workaround because `clipboardy` does not support Wayland (https://github.com/sindresorhus/clipboardy/issues/38)
// we silence errors because gnome users may not need/have wl-copy even on wayland, gnome makes xclip / xsel work anyway
if (isWayland) {
spawn('wl-copy', [randomLabelsMarkdown], { stdio: 'ignore' })
.on('error', () => {});
}
}

@@ -48,0 +62,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc