{"name":"copy-text-to-clipboard","version":"2.1.1","description":"Copy text to the clipboard in modern browsers (0.2 kB)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/copy-text-to-clipboard.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && tsd"},"keywords":["copy","text","clipboard","browser","clipboard.js","modern"],"devDependencies":{"tsd":"^0.7.2","xo":"^0.24.0"},"xo":{"envs":["browser"]},"gitHead":"7ee4cd9fa4afd5a0cedae2628eecaa09edac3103","bugs":{"url":"https://github.com/sindresorhus/copy-text-to-clipboard/issues"},"homepage":"https://github.com/sindresorhus/copy-text-to-clipboard#readme","_id":"copy-text-to-clipboard@2.1.1","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-oSuMj4ArDGSLcLPsDhzWOhalzOVV0ErCHNfZNNr+spC+iWJ6PVSLzPPrJw/rcdFZyOhugn8iw6O0nrpY/ZrEMg==","shasum":"5340e8620976d2dd9de0ff11493d13a80d600fd2","tarball":"http://registry-npm.ywwl.com/copy-text-to-clipboard/download/copy-text-to-clipboard-2.1.1.tgz","fileCount":5,"unpackedSize":4600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiFymCRA9TVsSAnZWagAA72wQAJp2JwnEi2Y2agZrlWbE\nJxlj7keE1F0q62rvMc2lgPkLp72fQbPgy8Y/gqUVb9yNL08UY03icZ0dXwRP\niyE7nLmAT1zFRb8qVOfVtpe6Wojzo55v6IxivrtNHmoDIAwbie1d3/2bnMIo\n6ILBL+mmXkiNqez4XH839GEix/+i8JMxtB9R5mGnjMEmCC9H8Wl5XwBqXPrO\nUCNNQs7FbqdYgIVVVOXtMNZos5FuI/Eqr7+KcpINNYSmULzubc0jezA5j+wm\nD4XYedWWUOgdS4CXAozuu16ihBouVl3Gkf0I8+Udoe39qCdPSWzFaX1HmHsB\nM+6sC9eOt50dXKQ4YFnSmNpJxKD0vmIAu0vWz7nRyFi/7p7eFftQhibuM9xs\nnya/6JZSfJPPipyrlrN/lgHBzKD8wsjqW4gryflelHc7RX2M8PchS1ZslADi\ncD90QZU7/y3T8Jco3+esVymqnbFuGpa7iQLcQAX5bUIOUEII+bMHZwXZr/F+\nm+EAp6cs2T5jtndjwYgFA7N0cGuZHXRATNx9R/TilXAyGi50e/Ftf4h/DWnk\nj52uKBGLCjUCXXrCUXV3QkqjK8OBVEFzhsP+cujZqtwlMlde7HGoEnrxW8pM\n4KkCJBmQJNKS1W6QHe70RrYkZ7OOeYX0AHH81iS2B7sjo+qrpnjqyvexTJbA\nfmfo\r\n=cipr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPi1qYvbSCdT/uaCgfeS+68p2uKQ+dsJ64QZMfv067pQIhAL+5WyoJ3JDblvanBdTgrjvU1Saz47jd5OXFj1dwWSuK"}],"size":2299,"noattachment":false,"key":"/copy-text-to-clipboard/-/copy-text-to-clipboard-2.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/copy-text-to-clipboard_2.1.1_1569217701270_0.23768470186606083"},"_hasShrinkwrap":false,"readme":"# copy-text-to-clipboard\n\n> Copy text to the clipboard in modern browsers *(0.2 kB)*\n\n[Try it out!](https://jsfiddle.net/sindresorhus/6406v3pf/)\n\n## Comparison\n\n- This module: **0.2 kB**\n- [`clipboard.js`](https://github.com/zenorocha/clipboard.js): 3.4 kB\n\n## Install\n\n```sh\nnpm install copy-text-to-clipboard\n```\n\n## Usage\n\n```js\nimport copy from 'copy-text-to-clipboard';\n\nbutton.addEventListener('click', () => {\n\tcopy('🦄🌈');\n});\n```\n\n## API\n\n### copy(text, options?)\n\nCopy `text` to the clipboard.\n\nReturns a `boolean` of whether it succeeded to copy the text.\n\nMust be called in response to a user gesture event, like `click` or `keyup`.\n\n#### options\n\nType: `object`\n\n##### target\n\nType: `HTMLElement`\\\nDefault: `document.body`\n\nSpecify a DOM element where the temporary, behind-the-scenes `textarea` should be appended, in cases where you need to stay within a focus trap, like in a modal.\n\n## Related\n\n- [clipboardy](https://github.com/sindresorhus/clipboardy) - Access the system clipboard (copy/paste) in Node.js\n","publish_time":1569217701376,"_cnpm_publish_time":1569217701376,"dist-tags":{"latest":"3.2.2"}}