1.0.3 • Published 4 years ago

copy-it-js v1.0.3

Weekly downloads
17
License
license.txt
Repository
-
Last release
4 years ago

COPY IT

Small size copy to clipboard code. No Flash. Demo

Install

npm install copy-it-js --save

or

yarn add copy-it-js

How to use?

Example 1:

import { copyText } from 'copy-it-js';

copyText("Copy Me");

Example 2:

import { copyElement } from 'copy-it-js';

copyElement(document.getElementById('someInput'))
<html>
    <head>...</head>
    <body>
        <input id="someInput" readonly value="copy me" />
    </body>
</html>

Example 3:

<html>
    <head>
        <script src="../dist/copy.min.js"></script>
    </head>
    <body>
        <input id="someInput" readonly value="copy me" />
        <script>
            copyit.copyElement(document.getElementById("someInput"));
        </script>
    </body>
</html>

Inspired From 1. https://github.com/zenorocha/clipboard.js 2. https://github.com/zenorocha/select