How to use copy-paste - 10 common examples

To help you get started, we’ve selected a few copy-paste 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 DefinitelyTyped / DefinitelyTyped / copy-paste / copy-paste-tests.ts View on Github external
/// 
/// 

import * as CopyPaste from 'copy-paste';

class TestClass {}

let strRet: string  = CopyPaste.copy("content");
strRet = CopyPaste.copy("content", (err: Error) => { return; });


let objRet: TestClass  = CopyPaste.copy(new TestClass());
objRet = CopyPaste.copy(new TestClass(), (err: Error) => { return; });

strRet = CopyPaste.paste();
CopyPaste.paste((err: Error, content: string) => { return; });
github DefinitelyTyped / DefinitelyTyped / copy-paste / copy-paste-tests.ts View on Github external
/// 
/// 

import * as CopyPaste from 'copy-paste';

class TestClass {}

let strRet: string  = CopyPaste.copy("content");
strRet = CopyPaste.copy("content", (err: Error) => { return; });


let objRet: TestClass  = CopyPaste.copy(new TestClass());
objRet = CopyPaste.copy(new TestClass(), (err: Error) => { return; });

strRet = CopyPaste.paste();
CopyPaste.paste((err: Error, content: string) => { return; });
github DefinitelyTyped / DefinitelyTyped / copy-paste / copy-paste-tests.ts View on Github external
/// 
/// 

import * as CopyPaste from 'copy-paste';

class TestClass {}

let strRet: string  = CopyPaste.copy("content");
strRet = CopyPaste.copy("content", (err: Error) => { return; });


let objRet: TestClass  = CopyPaste.copy(new TestClass());
objRet = CopyPaste.copy(new TestClass(), (err: Error) => { return; });

strRet = CopyPaste.paste();
CopyPaste.paste((err: Error, content: string) => { return; });
github naggie / dsdrop / bin / drop.js View on Github external
upload.on('done',function(url) {
	// TMUX messes up copy and paste in mac os x
	clipboard.copy(url,function(err) {
		if (!err && ! (process.env.TMUX && process.platform == 'darwin') )
			process.stderr.write("\nURL in clipboard: ".green)
		else
			process.stderr.write("\nURL: ".green)

		console.log(url)

		// this is necessary, due to
		// https://github.com/xavi-/node-copy-paste/issues/17 (Process will not exit)
		// https://github.com/xavi-/node-copy-paste/issues/18 (error callback fired twice)
		process.exit(0)
	})
})
github srijanshetty / snips / lib / functions.js View on Github external
module.exports.copySnippet = function (snippetName) {
    // Generate fileName
    var fileName = path.join(snippetsRoot, snippetName);

    // Check if there exists a snippet with the given name
    if (!fs.existsSync(fileName)) {
        process.exit(0);
    }

    // Get the text from the file
    var text = fs.readFileSync(fileName).toString();

    // Copy the text to clipboard
    require('copy-paste').copy(text, function() { process.exit(0); });
};
github mrmartineau / depdoc / cli.js View on Github external
// depdoc(program.file); // or
	result = depdoc(userArgs[0]);
}

// Results
if (userArgs.indexOf('-g') !== -1) {
	fs.writeFileSync(program.generate +'.md', result);
	process.stdout.write('Success! '+ program.generate +'.md has been created for you');
}

if (program.print) {
	process.stdout.write(result);
}

if (program.copy) {
	copyPaste.copy(result);
	process.stdout.write('Success! depdoc has copied the results to your clipboard');
}
github djyde / cown / lib / core / upload.js View on Github external
client.uploadFile(source, {key: filename }, (err, result) => {
    spin.stop()
    if (err) {
      utils.showError(err)
    } else {
      console.log(colors.green('Upload success!'))
      console.log(result.url)

      if (options.copy) {
        ncp.copy(result.url)
      }
    }
  })
}
github baumhoto / FeedlyTerminal / index.js View on Github external
screen.key('1', function() {
  var index = listEntries.getScroll();
  var text = listEntries.getItem(index).getText();
  var entry = entriesMap[text];
  if(entry.alternate != null)
  {
    clipboard.copy(entry.alternate[0].href);
    applescript.execString(nconf.get('applescript1').replace('$href$', entry.alternate[0].href), function(err, rtn) {
      if (err) {
        console.log(err);
      }
  });
  }
});
github chrenn / kju / logger.js View on Github external
copy() {
		this.clipboard.toggle = !this.clipboard.toggle;
		cp.copy(this.clipboard.toggle ? this.clipboard.hmac : this.clipboard.userAgent);
		console.log(chalk.dim('Copied latest', this.clipboard.toggle ? 'HMAC Cookie.' : 'UserAgent.'));
	}
github watilde / emoji-cli / lib / search.js View on Github external
}], function (o) {
    if (o.emoji === '.exit') {
      console.log('Exit')
      return
    }
    ncp.copy(o.emoji, function () {
      console.log('Copied ' + o.emoji)
    })
  })
}

copy-paste

A command line utility that allows read/write (i.e copy/paste) access to the system clipboard.

Unknown
Latest version published 10 months ago

Package Health Score

58 / 100
Full package analysis

Popular copy-paste functions