How to use the clipboardy.readSync function in clipboardy

To help you get started, we’ve selected a few clipboardy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brave / ethereum-remote-client / test / screens / new-ui.js View on Github external
await driver.findElement(By.css('.export-private-key__button')).click()
  await delay(300)
  await captureLanguageScreenShots('metamask account detail export private key screen - done')

  // get eth from Ganache
  // const viewAddressButton = await driver.findElement(By.css('.wallet-view__address'))
  // await driver.actions({ bridge: true }).move({ origin: viewAddressButton }).perform()
  // console.log('driver.actions', driver.actions({ bridge: true }))
  // await delay(300)
  // await captureLanguageScreenShots('metamask home - hover copy address')

  await driver.findElement(By.css('.wallet-view__address')).click()
  await delay(100)
  await captureLanguageScreenShots('metamask home - hover copy address')

  const primaryAddress = clipboardy.readSync()
  await requestEther(primaryAddress)
  // wait for block polling
  await delay(10000)
  await captureLanguageScreenShots('metamask home - has ether')

}
github satokaz / vscode-memo-life-for-you / src / memoNew.ts View on Github external
fs.statSync(this.memodir);
        } catch(err) {
            // console.log(err);
            vscode.window.showErrorMessage(localize('memodirAccessCheck', 'The directory set in memodir does not exist'));
            return;
        }

        // vscode 上選択されているテキストを取得
        if (this.memoNewFilenameFromSelection == true) {
            selectString = editor.document.getText(editor.selection);
        }

        // vscde 上で何も選択されていない (= 0) 場合は、clipboard を参照する
        if (this.memoNewFilenameFromClipboard == true) {
            if (selectString.length == 0) {
                selectString = clipboardy.readSync();
            }
        }
        // console.log('selectString =', selectString);

        let fileNameDateFormat: string = dateFns.format(new Date(), 'YYYY-MM-DD');
        let filNameDateSuffix: string = "";

        if (this.memoNewFilNameDateSuffix !== "") {
            filNameDateSuffix  = dateFns.format(new Date(), this.memoNewFilNameDateSuffix);
            
        }

        vscode.window.showInputBox({
            placeHolder: localize('enterFilename', 'Please Enter a Filename (default: {0}.md)', fileNameDateFormat + filNameDateSuffix),
            // prompt: "",
            value: `${selectString.substr(0,49)}`,
github airgap-it / airgap-wallet / e2e / src / app.e2e-spec.ts View on Github external
prepareButton.click()
      await page.waitForAngular()

      await page.takeScreenshot(`interaction-${account.symbol}`)

      const offlineButton = element(by.css('#offline'))
      offlineButton.click()
      await page.waitForAngular()

      await page.takeScreenshot(`qr-${account.symbol}`)

      const qrCode = element(by.css('#qr'))
      qrCode.click()
      await page.waitForAngular()

      const preparedTxClipboard = clipboardy.readSync()

      // expect(preparedTxClipboard).toEqual(account.preparedTx)

      const doneButton = element(by.css('#done'))
      doneButton.click()
      await page.waitForAngular()

      await mainWallet.click()
      await page.waitForAngular()

      const buttonPopover = element(by.css('#edit-popover'))
      await buttonPopover.click()
      await page.waitForAngular()
      await page.takeScreenshot(`tx-detail-popover-${account.symbol}`)

      const buttonDelete = element(by.css('#delete'))
github redhat-developer / vscode-extension-tester / src / webdriver / components / bottomBar / Views.ts View on Github external
async getText(): Promise {
        const workbench = new Workbench();
        await workbench.executeCommand('terminal select all');
        await workbench.getDriver().sleep(500);
        await workbench.executeCommand('terminal copy selection');
        await workbench.getDriver().sleep(500);
        const text = clipboard.readSync();
        clipboard.writeSync('');
        return text;
    }
github redhat-developer / vscode-extension-tester / src / webdriver / components / bottomBar / AbstractViews.ts View on Github external
async getText(): Promise {
        const textarea = await this.findElement(ChannelView.locators.BottomBarViews.textArea);
        await textarea.sendKeys(Key.chord(TextView.ctlKey, 'a'));
        await textarea.sendKeys(Key.chord(TextView.ctlKey, 'c'));
        const text = clipboard.readSync();
        await textarea.click();
        clipboard.writeSync('');
        return text;
    }
github JasonKleban / Framework7.d.ts / clip-docs-2.ts View on Github external
import * as clipboardy from 'clipboardy'

const rows = clipboardy.readSync();

const transformed = rows.split('\n')
    .map(row => {
        const cells = row.split('\t').map(cell => (cell || '').replace(/\n/g, ' ').trim());
        return `            /** ${cells[1]} */\n            ${cells[0].replace(/^.*\./g, '')}`;
    })
    .join('\n');

clipboardy.writeSync(transformed);

console.log(transformed);
github sindresorhus / clipboard-cli / cli.js View on Github external
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const getStdin = require('get-stdin');
const clipboardy = require('clipboardy');

meow(`
	Example
	  $ echo 🦄 | clipboard
	  $ clipboard
	  🦄
`);

if (process.stdin.isTTY || process.env.STDIN === '0') {
	console.log(clipboardy.readSync());
} else {
	(async () => {
		clipboardy.writeSync(await getStdin());
	})();
}
github qjebbs / vscode-markdown-extended / src / commands / pasteTable.ts View on Github external
execute() {
        let text = clip.readSync().trim();
        if (!text) return;
        let tableText = convertToMarkdownTable(text);
        if (!tableText) return;
        let editor = vscode.window.activeTextEditor;
        return editTextDocument(
            editor.document, [{
                range: editor.selection,
                replace: tableText
            }]
        );
    }
    constructor() {
github opticdev / optic / api-cli / src / commands / init.ts View on Github external
const events = niceTry(() => {
      const clipboardContents = clipboardy.readSync()
      const parsedJson = JSON.parse(clipboardContents)
      if (Array.isArray(parsedJson) && parsedJson.every(i => typeof i === 'object')) {
        return parsedJson
      }
    })
    if (!events) {
github mixn / carbon-now-cli / src / get-input.js View on Github external
return new Promise(async (resolve, reject) => {
		if (FILE) {
			resolve(await readFileAsync(FILE, 'utf8'));
		} else if (FROM_CLIPBOARD) {
			resolve(clipboardy.readSync());
		}	else {
			const STDIN = await getStdin();

			if (STDIN) {
				resolve(STDIN);
			} else {
				reject(new Error('No file or stdin given.'));
			}
		}
	});
};

clipboardy

Access the system clipboard (copy/paste)

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis