0.1.4 • Published 7 months ago
modern-copy-to-clipboard v0.1.4
Modern Copy to Clipboard
Provide a simple way to copy text, html, png, or custom MIME-type data to clipboard.
Example
import copy from 'modern-copy-to-clipboard'
// Copy plain text
copy('Text')
// Copy html
copy({
'text/plain': 'Hello World!',
'text/html': '<p>Hello World!</p>'
})
// Copy custom MIME-type data
copy({
'text/plain': 'Hello World!',
'text/html': '<p>Hello World!</p>'
'custom-data': '{"data":"Hello World!"}'
})
// Copy image
copy({
'image/png': fetch(src).then(response => response.blob())
})