Skip to content

Releases: styfle/copee

1.0.6

Choose a tag to compare

@styfle styfle released this 28 Jun 18:44
ba5d351

copee

npm
size
install size
Downloads
Dependency Status
devDependency Status
Build Status

Copy text from browser to clipboard...natively! Less than 1 kB!

Have you ever wanted to send a string to the user's clipboard? Front-end developers have invented many hacks to get around this limitation...until now!

Introducing copee, a micro-wrapper around the browser's native "copy text" API 🗜️

Death to Adobe Flash 💀

Demo

Try the demo to see copee in action!

You can view the page source to quickly learn how to use it.

Also, read this blog post for some background.

Browser ESM Usage

<script type="module">
    import { toClipboard } from 'https://cdn.jsdelivr.net/npm/copee/dist/copee.mjs';

    document.getElementById('btn').addEventListener('click', () => {
        const success = toClipboard('Wow, "copee" works via ES Modules!');
        if (success) {
            // it worked, check your clipboard!
        }
    });
</script>

Browser UMD Usage

<script src="https://cdn.jsdelivr.net/npm/copee/dist/copee.umd.js"></script>
<script type="text/javascript">
    document.getElementById('btn').addEventListener('click', function () {
        var success = copee.toClipboard('Wow, "copee" works!');
        if (success) {
            // it worked, check your clipboard!
        }
    });
</script>

Browser Suppport

  • UMD (.js) supports IE 11+, Chrome 43+, Opera 29+, and Firefox 41+
  • ESM (.mjs) supports Chrome 61+, Safari 10.1+, Edge 16+, and Firefox 60+

Prior Art

This package was influenced by the following:

Authors

Developed by ceriously.com

v1.0.6

Choose a tag to compare

@styfle styfle released this 20 Dec 12:49
  • Add browser and module keys to package.json #44
  • Upgrade to typescript@3.2.2
  • Upgrade to rollup@0.68.1

v1.0.5

Choose a tag to compare

@styfle styfle released this 03 Apr 00:21
  • fix possible null reference if using input[type=email]
  • fix license mismatch...everything should be MIT now
  • upgrade to typescript@2.8.1
  • upgrade to rollup@0.57.1

v1.0.4

Choose a tag to compare

@styfle styfle released this 12 Mar 00:03
  • update github pages url
  • update homepage url
  • update rollup devDependency

v1.0.3

Choose a tag to compare

@styfle styfle released this 12 Dec 15:40

Update documentation and add a "gzip size" badge.

v1.0.0

Choose a tag to compare

@styfle styfle released this 12 Dec 15:40

Stable release! This includes UMD and ESM versions of the script and well as better documentation.

See this blog post for more info.