Miss any of our Open RFC calls?Watch the recordings here! »

js-copy-clipboard

1.0.3 • Public • Published

js-copy-clipboard v1.0.2 Build Status

The js-copy-clipboard library as Front-end code copy clipboard, Add custom content to the copied clipboard

Using npm:

$ npm i -g npm
$ npm i --save js-copy-clipboard

Example

import copyClipboard from 'js-copy-clipboard';
 
copyClipboard([
  '作者:nanfeiyan',
  '链接:https://juejin.im/user/5b2db436f265da59961bd003/posts',
  '来源:juejin',
  '著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。',
]);

When you use Ctrl+C to copy your site, the pasted content will be followed by the content you need to attach, as shown below

Copied content...
作者:nanfeiyan
链接:https://juejin.im/user/5b2db436f265da59961bd003/posts
来源:juejin
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处.

Installation

Can be used as npm package and then leveraged using commonjs bundler/loader:

npm i --save copy-to-clipboard

Can be utilized using xxxx.com. Add following script to your page:

<script src='https://xxxx.com/lib/index.min.js' async></script>

You will have window.copyClipboard exposed for you to use.

See the package source for more details.

If you have any questions, please contact me 3328921305@qq.com

Install

npm i js-copy-clipboard

DownloadsWeekly Downloads

3

Version

1.0.3

License

none

Unpacked Size

8.31 kB

Total Files

5

Last publish

Collaborators

  • avatar