Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/component/clipboard

Clipboard API wrapper
https://github.com/component/clipboard

Last synced: 12 days ago
JSON representation

Clipboard API wrapper

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