Skip to content

33033624/copy-text-to-clipboard

 
 

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

 
 
 

Languages

  • JavaScript 57.8%
  • HTML 42.2%