0.1.1 • Published 7 years ago

exec-copy v0.1.1

Weekly downloads
130
License
MIT
Repository
github
Last release
7 years ago

exec-copy

Copy text to clipboard using execCommand('copy') on Web browser.

CircleCI

Usage

var execCopy = require('exec-copy')

button.addEventListener('click', function (e) {
  execCopy('this is copied text!!')
})

Fallback

Some browser (e.g. Safari) doesnot have execCommand('copy'). For fallback, This library automatically open window.prompt.

fallback

Also you can overwrite fallback if you need.

execCopy('this is copied text!!', function (str) {
  // do something when execCommand('copy') is not available
})

Sample

build sample code (./sample/source.js)

% npm install
% npm run build

open ./sample/index.html

0.1.1

7 years ago

0.1.0

7 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago