Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.
/ pastrami Public archive

Functional Cross-browser Clipboard Pastin' Never Tasted So Good 😋

License

Notifications You must be signed in to change notification settings

davidchase/pastrami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pastrami

Functional Cross-browser Clipboard Pastin' Never Tasted So Good 😋

Install

npm i -S pastrami

Usage

<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))

Why

Demo

https://goo.gl/tDTBVS

API

pastrami(element)

Returns a function with the result from clipboard

element

Type: Element

DOM Element with a contenteditable attribute

Supported Browsers

  • Chrome 59/61
  • Firefox 53
  • Safari 10
  • IE 11/Edge

TODO

  • Add Tests
  • Test in IE