{"name":"copy-text-to-clipboard","version":"3.2.2","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"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=12"},"scripts":{"//test":"xo && tsd","test":"xo"},"keywords":["copy","text","clipboard","browser","clipboard.js","modern"],"devDependencies":{"tsd":"^0.14.0","xo":"^0.37.1"},"xo":{"envs":["browser"]},"_id":"copy-text-to-clipboard@3.2.2","gitHead":"93063621594a422c1bbb917dc5c160ab4f2c7252","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/copy-text-to-clipboard/issues"},"homepage":"https://github.com/sindresorhus/copy-text-to-clipboard#readme","_nodeVersion":"20.19.5","_npmVersion":"10.9.2","dist":{"integrity":"sha512-T6SqyLd1iLuqPA90J5N4cTalrtovCySh58iiZDGJ6FGznbclKh4UI+FGacQSgFzwKG77W7XT5gwbVEbd9cIH1A==","shasum":"99bc79db3f2d355ec33a08d573aff6804491ddb9","tarball":"http://registry-npm.ywwl.com/copy-text-to-clipboard/download/copy-text-to-clipboard-3.2.2.tgz","fileCount":5,"unpackedSize":5601,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEUxfwBcbPgpdP7UZVzrYulO7EOWzSYw3ek9+gB6rnAMAiAJxz4MYrjQEpUl9/+xEmhtXX+5L/NHNIlfJgAqzxt4xA=="}],"size":2692,"noattachment":false,"key":"/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/copy-text-to-clipboard_3.2.2_1758654155233_0.9785643365448025"},"_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":1758654155404,"_cnpm_publish_time":1758654155404,"dist-tags":{"latest":"3.2.2"}}