Functional Cross-browser Clipboard Pastin' Never Tasted So Good 😋
npm i -S pastrami
<div contenteditable class="paste">Paste Here</div>
<div class="results"></div>
import { pastrami } from 'pastrami'
const run = pastrami(document.querySelector('.paste'))
run(img => document.querySelector('.results').appendChild(img))
- Needed a way to interact with ClipboardEvent
- Cross Browser Friendly
Returns a function with the result from clipboard
Type: Element
DOM Element with a contenteditable attribute
- Chrome 59/61
- Firefox 53
- Safari 10
- IE 11/Edge
- Add Tests
- Test in IE