- install package
npm i simple-copy-to-clipboard
- import function
copy
in your code. For example
import copy from 'simple-copy-to-clipboard';
- run function passed your text there. For example
copy('your awesome text');
- if all right, function returns
true
. If fail, returnsfalse
. - Enjoy :)
index.js size is 0.642 kb
I download it from internet and didnt want paste it manually. I like use stuff like this via node-modules.
Have not full list, but it supports even old browsers.