abc-copy
version 0.01
abc-copy is a browser tools that helps you to copy text using navigator.clipboard
API and TextRange simulation copy.
install
$ npm install abc-copy
import
const abcCopy =
demo
const abcCopy = // normal copy(not in modal)
api
params
content <string>
the text you want to copy to your clipboard.option <object>(optional)
- target: A HtmlDomElement that mounted the hidden TextRange when using the TextRange strategy.Default value is
document.body
- target: A HtmlDomElement that mounted the hidden TextRange when using the TextRange strategy.Default value is
return
Promise<void>
indicating the result of the copy action, resolve means success while reject means failure.