{"id":13448526,"url":"https://github.com/styfle/copee","last_synced_at":"2025-04-12T15:35:54.157Z","repository":{"id":35286902,"uuid":"39547867","full_name":"styfle/copee","owner":"styfle","description":"📄 Copy text from browser to clipboard...natively! \u003c 1kB","archived":false,"fork":false,"pushed_at":"2025-04-02T20:57:06.000Z","size":315,"stargazers_count":148,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T16:11:08.866Z","etag":null,"topics":["browser-api","clipboard","copy","text"],"latest_commit_sha":null,"homepage":"https://copee.ceriously.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/styfle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-23T05:38:28.000Z","updated_at":"2025-04-02T20:57:08.000Z","dependencies_parsed_at":"2023-10-02T18:57:55.237Z","dependency_job_id":"72888c97-be0f-4a14-bb9b-f531975c193b","html_url":"https://github.com/styfle/copee","commit_stats":{"total_commits":243,"total_committers":6,"mean_commits":40.5,"dds":0.6460905349794239,"last_synced_commit":"cadfbf93cd64f868011b3c3cc8e4c98555588a81"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fcopee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fcopee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fcopee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/styfle%2Fcopee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/styfle","download_url":"https://codeload.github.com/styfle/copee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590199,"owners_count":21129766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-api","clipboard","copy","text"],"created_at":"2024-07-31T05:01:48.030Z","updated_at":"2025-04-12T15:35:54.134Z","avatar_url":"https://github.com/styfle.png","language":"TypeScript","readme":"# copee\n\n[![npm](https://badgen.net/npm/v/copee)](https://www.npmjs.com/package/copee)\n[![size](https://badgen.net/badgesize/gzip/https://cdn.jsdelivr.net/npm/copee/dist/copee.umd.js)](https://cdn.jsdelivr.net/npm/copee/dist/copee.umd.js)\n[![install size](https://badgen.net/packagephobia/install/copee)](https://packagephobia.now.sh/result?p=copee)\n[![Downloads](https://badgen.net/npm/dt/copee)](https://www.npmjs.com/package/copee)\n[![Dependency Status](https://badgen.net/david/dep/styfle/copee)](https://david-dm.org/styfle/copee)\n[![devDependency Status](https://badgen.net/david/dev/styfle/copee)](https://david-dm.org/styfle/copee?type=dev)\n[![Build Status](https://badgen.net/travis/styfle/copee)](https://travis-ci.org/styfle/copee)\n\nCopy text from browser to clipboard...natively! Less than 1 kB!\n\nHave you ever wanted to send a string to the user's clipboard? Front-end developers have invented many hacks to get around this limitation...until now!\n\nIntroducing `copee`, a micro-wrapper around the browser's native \"copy text\" API 🗜️\n\nDeath to Adobe Flash 💀\n\n## Demo\n\n[Try the demo](https://copee.ceriously.com/) to see `copee` in action!\n\nYou can view the page source to quickly learn how to use it.\n\nAlso, read [this blog post](https://styfle.dev/blog/es6-modules-today-with-typescript) for some background.\n\n## Browser ESM Usage\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { toClipboard } from 'https://cdn.jsdelivr.net/npm/copee/dist/copee.mjs';\n\n  document.getElementById('btn').addEventListener('click', () =\u003e {\n    const success = toClipboard('Wow, \"copee\" works via ES Modules!');\n    if (success) {\n      // it worked, check your clipboard!\n    }\n  });\n\u003c/script\u003e\n```\n\n## Browser UMD Usage\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/copee/dist/copee.umd.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  document.getElementById('btn').addEventListener('click', function () {\n    var success = copee.toClipboard('Wow, \"copee\" works!');\n    if (success) {\n      // it worked, check your clipboard!\n    }\n  });\n\u003c/script\u003e\n```\n\n## Browser Suppport\n\n- UMD (`.js`) supports IE 11+, Chrome 43+, Opera 29+, and Firefox 41+\n- ESM ([.mjs](https://caniuse.com/#feat=es6-module)) supports Chrome 61+, Safari 10.1+, Edge 16+, and Firefox 60+\n\n## Prior Art\n\nThis package was influenced by the following:\n\n- [Google Dev Blog](https://developers.google.com/web/updates/2015/04/cut-and-copy-commands) \n- [Mozilla Hacks](https://hacks.mozilla.org/2015/09/flash-free-clipboard-for-the-web/)\n- [StackOverflow](https://stackoverflow.com/a/30810322/266535)\n\n## Authors\n\nDeveloped by [styfle](https://styfle.dev)\n","funding_links":[],"categories":["TypeScript","Modules","模块"],"sub_categories":["Browser","浏览器"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyfle%2Fcopee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyfle%2Fcopee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyfle%2Fcopee/lists"}