0.0.11 • Published 4 years ago

abc-copy v0.0.11

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

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 = require('abc-copy')

demo

const abcCopy = require('abc-copy')

// normal copy(not in modal)
abcCopy('content')
<div class="modal" id="modal-content-id"></div>

<script>
// copy in an modal
abcCopy('content', {
  target: document.getElementById('modal-content-id')
})
</script>

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

return

  • Promise<void> indicating the result of the copy action, resolve means success while reject means failure.
0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago