Package Exports
- clipboard-copy
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (clipboard-copy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
clipboard-copy

Lightweight copy to clipboard for web pages
The goal of this package is to offer simple copy-to-clipboard functionality in modern web browsers using the fewest bytes. To do so, this package only supports modern browsers. No fallback using Adobe Flash, no hacks. Just 25 lines of code.
Works in the browser with browserify!
install
npm install clipboard-copyusage
const copy = require('clipboard-copy')
button.addEventListener('click', function () {
copy('This is some cool text')
})API
copy(text)
Copy the given text to the user's clipboard.
Note: in most browsers, copying to the clipboard is only allowed if copy() is
triggered in direct response to a user gesture like a 'click' or a 'keypress'.
comparison to alternatives
clipboard-copy(this package): 465 bytesclipboard-js: 1.83 kBclipboard: 3.19 kB
license
MIT. Copyright (c) Feross Aboukhadijeh.