{"id":20533039,"url":"https://github.com/ferrriii/text-copy","last_synced_at":"2025-04-14T06:32:42.188Z","repository":{"id":101857096,"uuid":"224404161","full_name":"ferrriii/text-copy","owner":"ferrriii","description":"a small js library for copying text to clipboard","archived":false,"fork":false,"pushed_at":"2021-06-03T13:08:51.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T18:08:52.060Z","etag":null,"topics":["clipboard","js-library","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ferrriii.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":"2019-11-27T10:23:42.000Z","updated_at":"2021-06-03T13:07:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b078cde-dd4d-4ba0-b6cd-e407ca92daaa","html_url":"https://github.com/ferrriii/text-copy","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"5b7e8536cdbdfd5ee0ce802cabcd3e17f95dd110"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferrriii%2Ftext-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferrriii%2Ftext-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferrriii%2Ftext-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferrriii%2Ftext-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferrriii","download_url":"https://codeload.github.com/ferrriii/text-copy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248834212,"owners_count":21168986,"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":["clipboard","js-library","npm-package"],"created_at":"2024-11-16T00:18:24.977Z","updated_at":"2025-04-14T06:32:42.134Z","avatar_url":"https://github.com/ferrriii.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-copy\r\n\u003cimg alt=\"downloads\" src=\"https://img.shields.io/npm/dt/text-copy?style=flat-square\"\u003e \u003cimg alt=\"version\" src=\"https://img.shields.io/npm/v/text-copy?style=flat-square\"\u003e \u003cimg alt=\"issues\" src=\"https://img.shields.io/github/issues/ferrriii/text-copy?style=flat-square\"\u003e \u003cimg alt=\"package size\" src=\"https://img.shields.io/bundlephobia/minzip/text-copy?style=flat-square\"\u003e \u003cimg alt=\"forks\" src=\"https://img.shields.io/github/forks/ferrriii/text-copy?style=flat-square\"\u003e \u003cimg alt=\"stars\" src=\"https://img.shields.io/github/stars/ferrriii/text-copy?style=flat-square\"\u003e \u003cimg alt=\"license\" src=\"https://img.shields.io/github/license/ferrriii/text-copy?style=flat-square\"\u003e \u003cimg alt=\"programming language\" src=\"https://img.shields.io/github/languages/top/ferrriii/text-copy?style=flat-square\"\u003e\r\n\r\na small js library ( \u003cimg alt=\"preview badge\" src=\"https://img.shields.io/bundlephobia/minzip/text-copy?style=flat-square\"\u003e ) for copying text to clipboard.\r\n\r\nTested on: Chrome, Firefox, Safari, Edge and IE11.\r\n\r\n## Browser usage\r\nLoad `index.js`. You can use a CDN like below.\r\n```\r\n\u003cscript src=\"//cdn.jsdelivr.net/npm/text-copy/index.min.js\" \u003e\u003c/script\u003e\r\n```\r\nThen `CopyText` function is availabe. Use it like below.\r\n\r\n```\r\n\u003cbutton onClick=\"CopyText('text to copy')\"\u003ecopy\u003c/button\u003e\r\n```\r\n\r\n`CopyText()` returns `true` if text is successfully copied.\r\n\r\n## NPM usage\r\nIf you want to use it in JS frameworks like Vue or React, install it as below.\r\n```\r\nnpm i text-copy\r\n```\r\nand then use it as below\r\n```\r\nimport copy from 'text-copy'\r\n\r\n// some where it the code\r\nlet isCopied = copy('text to copy')\r\n```\r\n\r\n**Note**: copy function should be called inside a user-generated event listener.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferrriii%2Ftext-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferrriii%2Ftext-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferrriii%2Ftext-copy/lists"}