Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/clipboard
Clipboard API wrapper
https://github.com/component/clipboard
Last synced: 12 days ago
JSON representation
Clipboard API wrapper
- Host: GitHub
- URL: https://github.com/component/clipboard
- Owner: component
- Created: 2012-08-16T19:57:45.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-16T20:53:07.000Z (almost 10 years ago)
- Last Synced: 2024-08-10T22:56:41.590Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 188 KB
- Stars: 21
- Watchers: 5
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# Clipboard
Clipboard library.
## Installation
```
$ component install component/clipboard
```## Example
```js
var Clipboard = require('clipboard');
var clip = new Clipboard(window);clip.on('paste', function(e){
e.items.forEach(function(item){
console.log(item);
});
});clip.on('cut', function(){
console.log('cut');
});clip.on('copy', function(e){
console.log('copy');
});
```## API
### Clipboard#bind()
Bind event handlers. This is done for you in the constructor.
### Clipboard#unbind()
Unbind event handlers.
## Links
- w3c [clipboard apis](http://www.w3.org/TR/clipboard-apis/)
## License
MIT