0.0.3 • Published 3 years ago

tiny-clipboard v0.0.3

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

tiny-clipbord

Introduction

A tiny copy to clipboard library, without any dependence. It is small(only 1.04k) and Simple to use in javascript.

Features

  • small
  • simple
  • useful
  • support typescript

Usage

# install
npm install tiny-clipboard --save
import TinyClipbord from 'tiny-clipbord'

TinyClipbord.copy(text, callback)

or you can use it by script tag

<script src="https://unpkg.com/tiny-clipbord@0.0.3/libs/tiny-clipbord.umd.min.js"></script>
<script>
   TinyClipbord.copy(text, callback) 
</script>

Methods

  • TinyClipbord.copy(text, callback)

    • text: the text you want to copy

    • callback(error ?) After copying successfully it will be run, and when appear error that will throw the error

  • TinyClipbord.getHistory()

    • return String[], the history that you have copied
  • TinyClipbord.clearHistroy() clear the history

Browser Support

ChromeFirefoxSafariOperaEdge
42+ ✔41+ ✔10+ ✔29+ ✔12+ ✔9+ ✔

Contributing

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.

License

MIT Licensed © suporka

Questions or advise

If you have some question or advise, you can send me a E-mail(zxpscau@163.com).