{"name":"copy-text-to-clipboard","version":"3.2.1","keywords":["copy","text","clipboard","browser","clipboard.js","modern"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"copy-text-to-clipboard@3.2.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/copy-text-to-clipboard#readme","bugs":{"url":"https://github.com/sindresorhus/copy-text-to-clipboard/issues"},"xo":{"envs":["browser"]},"dist":{"shasum":"01c3656d6c81a6aa713aa0a8d361214a1eeac6ae","tarball":"http://registry-npm.ywwl.com/copy-text-to-clipboard/download/copy-text-to-clipboard-3.2.1.tgz","fileCount":5,"integrity":"sha512-3am6cw+WOicd0+HyzhC4kYS02wHJUiVQXmAADxfUARKsHBkWl1Vl3QQEiILlSs8YcPS/C0+y/urCNEYQk+byWA==","signatures":[{"sig":"MEUCIQCTo6b6gInXjO7D6tc6AfJGA5J/ZF7L+NewA1Sgv8C36gIgG9UGnhL0Hzv2PYnx8ouG3HyMMmqEwDVLjPE8dRaXyYQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5518,"size":2659,"noattachment":false,"key":"/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.1.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=12"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"209b8518218f2663a6febfef2d2d7804abcf7443","scripts":{"test":"xo","//test":"xo && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/copy-text-to-clipboard.git","type":"git"},"_npmVersion":"10.9.2","description":"Copy text to the clipboard in modern browsers (0.2 kB)","directories":{},"sideEffects":false,"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.37.1","tsd":"^0.14.0"},"_npmOperationalInternal":{"tmp":"tmp/copy-text-to-clipboard_3.2.1_1757326398206_0.6937135672515191","host":"s3://npm-registry-packages-npm-production"},"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":1757326398387,"_cnpm_publish_time":1757326398387,"dist-tags":{"latest":"3.2.2"}}