https://github.com/egoist/modern-copy
Precompiled @sindresorhus/copy-text-to-clipboard (ES5, still 0.2kB)
https://github.com/egoist/modern-copy
clipboard copy copy-text-to-clipboard
Last synced: 25 days ago
JSON representation
Precompiled @sindresorhus/copy-text-to-clipboard (ES5, still 0.2kB)
- Host: GitHub
- URL: https://github.com/egoist/modern-copy
- Owner: egoist
- License: mit
- Created: 2017-05-22T11:50:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T14:05:57.000Z (over 3 years ago)
- Last Synced: 2025-04-10T18:57:25.661Z (about 2 months ago)
- Topics: clipboard, copy, copy-text-to-clipboard
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# modern-copy
[](https://npmjs.com/package/modern-copy) [](https://npmjs.com/package/modern-copy) [](https://github.com/egoist/donate)
> A precompiled version of [sindresorhus/copy-text-to-clipboard](https://github.com/sindresorhus/copy-text-to-clipboard), clipboard in modern browsers.
## Install
```bash
❯ npm install modern-copy
```CDN: [UNPKG](https://unpkg.com/modern-copy/dist/) | [jsDelivr](https://cdn.jsdelivr.net/npm/modern-copy/dist/)
## Usage
Direct use it in your build process, without any extra config:
```js
import mcopy from 'modern-copy'button.addEventListener('click', () => {
mcopy('👌🙋')
// Must be called in response to a user gesture event, like click or keyup.
})
```Or CDN version, access it via `window.mcopy`:
```html
```
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**modern-copy** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/modern-copy/contributors)).> [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@rem_rin_rin](https://twitter.com/rem_rin_rin)