{"_id":"@cjser/copy-text-to-clipboard","name":"@cjser/copy-text-to-clipboard","dist-tags":{"latest":"3.2.2-cjser.2"},"versions":{"3.2.2-cjser.2":{"name":"@cjser/copy-text-to-clipboard","version":"3.2.2-cjser.2","description":"Copy text to the clipboard in modern browsers (0.2 kB)","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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","require":"./dist-cjser/index.cjs","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"]},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.2.2","cjserVersion":2,"original":{"name":"copy-text-to-clipboard","version":"3.2.2","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/copy-text-to-clipboard","files":["index.js","index.d.ts"],"scripts":{"//test":"xo && tsd","test":"xo"}}},"_id":"@cjser/copy-text-to-clipboard@3.2.2-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-DLkbBYSadJuGGcB1mYksFZ9j4jHshwbUe30O2FENTs9hIETeKoMXrJ9EDPtH6Wa6PYEKbxjfvjXF87zELqaKTQ==","shasum":"42d827acf74dabc860d65fda7edfff302fd9f9e9","tarball":"https://registry.npmjs.org/@cjser/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.2-cjser.2.tgz","fileCount":6,"unpackedSize":9018,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCRExBFNkz449C6FzcrpXWvKM6awjeL5nngqS7dOA5HfAIhALWR5kDcnPsqdhMJ0idkRUHY3WWTVUSmC3L66AWn3S0E"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/copy-text-to-clipboard_3.2.2-cjser.2_1778157718321_0.8139730418579894"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:41:58.171Z","3.2.2-cjser.2":"2026-05-07T12:41:58.451Z","modified":"2026-05-07T12:41:58.629Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Copy text to the clipboard in modern browsers (0.2 kB)","keywords":["copy","text","clipboard","browser","clipboard.js","modern"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/copy-text-to-clipboard\n","readmeFilename":"readme.md","_rev":"1-be18ec5fd1cbbeb8c59a1a3dda846c63"}