Skip to content

Ventiv-Technology/copy-text-to-clipboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

copy-text-to-clipboard Build Status

Copy text to the clipboard in modern browsers (0.2 kB)

Try it out!

Comparison

Install

$ npm install copy-text-to-clipboard

Usage

const copy = require('copy-text-to-clipboard');

button.addEventListener('click', () => {
	copy('🦄🌈');
});

API

copy(text)

Copy text to the clipboard.

Returns a boolean of whether it succeeded.

Must be called in response to a user gesture event, like click or keyup.

Related

  • clipboardy - Access the system clipboard (copy/paste) in Node.js

License

MIT © Sindre Sorhus

About

Copy text to the clipboard in modern browsers (0.2 kB)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 57.6%
  • HTML 42.4%