copy-it-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i copy-it-js

Weekly Downloads

0

Version

1.0.3

License

license.txt

Unpacked Size

45.3 kB

Total Files

35

Last publish

Collaborators

  • ajshres