{"name":"copy-text-to-clipboard","version":"1.0.3","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":">=4"},"scripts":{"test":"xo"},"files":["index.js"],"keywords":["copy","text","clipboard","browser","clipboard.js","modern"],"devDependencies":{"xo":"*"},"xo":{"envs":["browser"]},"gitHead":"00c022e4eb4d0b34a7fcf5d04ea0a147b5bd4dad","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@1.0.3","_shasum":"69662cd305493c925c02a384cbcae76d642d77f3","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"69662cd305493c925c02a384cbcae76d642d77f3","tarball":"http://registry-npm.ywwl.com/copy-text-to-clipboard/download/copy-text-to-clipboard-1.0.3.tgz","integrity":"sha512-EaEooSRHgq8wJhUHfinwH3LUIVVDc3UbJKy17z2S5g/3LKoIWnnxt6JlC9MlDKWCpGuTkNxDctfy6m+dm0D5/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdn/y+ko5CmQEvQN7gePAQBLZR6OvZ7pSbg7678N1QeAiEA9ZnagMBf5G6JWXvG2V8RnUTsh3peaWHYHM6sX2btUHc="}],"size":2012,"noattachment":false,"key":"/copy-text-to-clipboard/-/copy-text-to-clipboard-1.0.3.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/copy-text-to-clipboard-1.0.3.tgz_1503216591153_0.7572517560329288"},"directories":{},"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":1503216591236,"_cnpm_publish_time":1503216591236,"dist-tags":{"latest":"3.2.2"}}