{"_id":"@copyai/copy-to-clipboard","name":"@copyai/copy-to-clipboard","dist-tags":{"latest":"3.3.3"},"versions":{"3.3.3":{"name":"@copyai/copy-to-clipboard","version":"3.3.3","description":"Copy stuff into clipboard using JS with fallbacks","main":"index.js","types":"index.d.ts","scripts":{"pretest":"browserify ./index.js --standalone copyToClipboard | uglifyjs -cm > example/index.js","test":"nightwatch"},"keywords":["clipboard","copy","browser"],"author":{"name":"sudodoki","email":"smd.deluzion@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/sudodoki/copy-to-clipboard.git"},"contributors":[{"name":"Aleksej Shvajka","url":"https://github.com/shvaikalesh"}],"dependencies":{"toggle-selection":"^1.0.6"},"directories":{"example":"example"},"devDependencies":{"browserify":"^13.0.1","minimist":"^1.2.6","nightwatch":"^2.3.0","@brettz9/node-static":"^0.1.1","optimist":"^0.5.2","selenium-server-standalone-jar":"2.53.0","uglify-js":"^3.5.3"},"gitHead":"8fedeb8e15a6da894f786088b8ba66631d773195","bugs":{"url":"https://github.com/sudodoki/copy-to-clipboard/issues"},"homepage":"https://github.com/sudodoki/copy-to-clipboard#readme","_id":"@copyai/copy-to-clipboard@3.3.3","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-0W/J5VAW0qASEjurOCpBh5IGA+CSM5pObjWtkRTKkPZlUfVYNqmIxx2Iboxblu/namirL80f2yPNbHsWqmBMtA==","shasum":"a0583866659c573d95d47b118b39de852bd8a592","tarball":"https://registry.npmjs.org/@copyai/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz","fileCount":8,"unpackedSize":15301,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBphW2fm1IISb7aB5uwE0O/rga1h0/0oBK+FaOF7RDftAiBIKtRw67Jp29CzVN5+jsd7Y3IdHsuI4nvmrduvpa0izw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/OZRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZAg//Q/jnsEtfe3Y7z8nMBIYLUWTIIyGtCjJL0OMhftZk79C+iXxO\r\n7WH4jOLblGomaAI5MYXqMhjqLPrLO2DKK3eTKAr13BS+JQeLGAQaO0K6tc8S\r\nAVfWNPXQvAIe2RWhwy4PVaWdV3iMv7tFMtL7Pzc/iQUgIwmweYtLFOx5qWHI\r\nAXk2II9/LQYOQBInmUX+DGpJjlnjInVrMEUHnditDMts6tbX43xmtL6EiUmb\r\nxUdFVC3K6zxZJ5/y+hUzP9MHF5F5QnLF2jGc2wC8m9LISGukMz7SAyQ7d2Cb\r\npOOdTo7PtgSeeR6Gkffgh90SHbbySawwyXIct1pmt7MMgIhboLjSmySl5HKK\r\nN2N6gfvXBx/w4Ot2Qak638q0bWatnYP+mmn+OXyaJQUFueN6j5tZTdFqCPix\r\nnPXPI01QXJnzT7ODfzu3pa6B3cg/oqFGjn8awpLikX01UOVmuEYeMXWhdr+S\r\nuYBCy2SvxnvxvT/2LYfyLJutQx7UZ15xL08EhN2JpIWfjI3netZYIZK/NLu8\r\n+Nc7ZgVh7VUbVFiMOpFgFrI7bsRnjC7PFus6uL2jwWSM+mYtEvFsFe8QT8X6\r\nRFX/LJqVyCY0pOIronUUqA6iSLBpySRypfV2PKPCfpgzwuaOSZexB0dG1BAX\r\nutnTvBU+Yebq4J/fu0G2SuXlvCwH3LoQZy4=\r\n=Dn4Z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"toots","email":"toots@rastageeks.org"},"maintainers":[{"name":"toots","email":"toots@rastageeks.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/copy-to-clipboard_3.3.3_1677518417794_0.10711087840583633"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-27T17:20:17.734Z","3.3.3":"2023-02-27T17:20:17.956Z","modified":"2023-02-27T17:20:18.214Z"},"maintainers":[{"name":"toots","email":"toots@rastageeks.org"}],"description":"Copy stuff into clipboard using JS with fallbacks","homepage":"https://github.com/sudodoki/copy-to-clipboard#readme","keywords":["clipboard","copy","browser"],"repository":{"type":"git","url":"git+https://github.com/sudodoki/copy-to-clipboard.git"},"contributors":[{"name":"Aleksej Shvajka","url":"https://github.com/shvaikalesh"}],"author":{"name":"sudodoki","email":"smd.deluzion@gmail.com"},"bugs":{"url":"https://github.com/sudodoki/copy-to-clipboard/issues"},"license":"MIT","readme":"# Copy to clipboard [![Build Status](https://travis-ci.org/sudodoki/copy-to-clipboard.svg?branch=master)](https://travis-ci.org/sudodoki/copy-to-clipboard)\n\nSimple module exposing `copy` function that will try to use [execCommand](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#) with fallback to IE-specific `clipboardData` interface and finally, resort to usual `prompt` with proper text content and message.\n\n> If you are building using [Electron](http://electronjs.org/), use [their API](https://www.electronjs.org/docs/latest/api/clipboard).\n\n# Example\n\n```js\nimport copy from 'copy-to-clipboard';\n\ncopy('Text');\n\n// Copy with options\ncopy('Text', {\n  debug: true,\n  message: 'Press #{key} to copy',\n});\n```\n\n# API\n\n`copy(text: string, options: object): boolean` &mdash; tries to copy text to clipboard. Returns `true` if no additional keystrokes were required from user (so, `execCommand`, IE's `clipboardData` worked) or `false`.\n\n|Value |Default |Notes|\n|------|--------|-----|\n|options.debug  |false| `Boolean`. Optional. Enable output to console. |\n|options.message|Copy to clipboard: `#{key}`, Enter| `String`. Optional. Prompt message. `*` |\n|options.format|\"text/html\"| `String`. Optional. Set the MIME type of what you want to copy as. Use `text/html` to copy as HTML, `text/plain` to avoid inherited styles showing when pasted into rich text editor. |\n|options.onCopy|null| `function onCopy(clipboardData: object): void`. Optional. Receives the clipboardData element for adding custom behavior such as additional formats |\n\n`*` all occurrences of `#{key}` are replaced with `⌘+C` for macOS/iOS users, and `Ctrl+C` otherwise.\n\n# [Browser support](http://caniuse.com/#feat=document-execcommand)\n\nWorks everywhere where `prompt`* is available. Works best (i.e. without additional keystrokes) in Chrome, FF, Safari 10+, and, supposedly, IE/Edge.\n\nNote: **does not work on some older iOS devices.**  \n`*` – even though **Safari 8** has `prompt`, you cannot specify prefilled content for prompt modal – thus it **doesn't work** as expected.\n\n# Installation\n\n+ Can be used as npm package and then leveraged using commonjs bundler/loader:\n```\nnpm i --save copy-to-clipboard\n```\n+ Can be utilized using [wzrd.in](https://wzrd.in/). Add following script to your page:\n```html\n<script src=\"https://wzrd.in/standalone/copy-to-clipboard@latest\" async></script>\n```\nYou will have `window.copyToClipboard` exposed for you to use.\n\n# UI components based on this package:\n+ [react-copy-to-clipboard](https://github.com/nkbt/react-copy-to-clipboard)\n+ [copy-button](https://github.com/sudodoki/copy-button)\n\n# See also:\n+ [clipboard-copy](https://github.com/feross/clipboard-copy) by [@feross](https://github.com/feross)\n+ [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#Browser_Compatibility)\n+ [April 2015 update on Cut and Copy Commands](http://updates.html5rocks.com/2015/04/cut-and-copy-commands)\n\n# Running Tests\nThis project has some automated tests, that will run using [nightwatch](nightwatchjs.org) on top of [selenium](http://www.seleniumhq.org/).\n\n```\nnpm i\nnpm test\n```\n# Typescript\nThis library has built-in Typescript definitions.\n\n```\nimport * as copy from 'copy-to-clipboard';\n```\n","readmeFilename":"README.md"}