Answers for "copy to clipboard js without exec"

18

copy text to clipboard javascript

//As simple as this
navigator.clipboard.writeText("Hello World");
Posted by: Guest on February-23-2021
2

node.js copy to clipboard

// Copy to clipboard in node.js
const child_process = require('child_process')

// This uses an external application for clipboard access, so fill it in here
// Some options: pbcopy (macOS), xclip (Linux or anywhere with Xlib)
const COPY_APP = 'xclip'
function copy(data, encoding='utf8') {
  const proc = child_process.spawn(COPY_APP)
  proc.stdin.write(data, {encoding})
  proc.stdin.end()
}
Posted by: Guest on April-22-2021

Code answers related to "copy to clipboard js without exec"

Code answers related to "Javascript"

Browse Popular Code Answers by Language