{"id":16439150,"url":"https://github.com/posva/clipboard-text","last_synced_at":"2025-09-11T06:31:41.568Z","repository":{"id":36977376,"uuid":"198408156","full_name":"posva/clipboard-text","owner":"posva","description":"Simple and small copy-text-to-the-clipboard-utility with IE11 support","archived":false,"fork":false,"pushed_at":"2024-10-14T03:58:57.000Z","size":133,"stargazers_count":13,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-17T00:12:36.599Z","etag":null,"topics":["browser","clipboard","copy","text"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","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},"funding":{"github":"posva"}},"created_at":"2019-07-23T10:30:42.000Z","updated_at":"2024-10-14T03:58:34.000Z","dependencies_parsed_at":"2024-01-22T05:28:41.816Z","dependency_job_id":"5c85ee79-6185-44f0-8bce-4a3f2fe1c02a","html_url":"https://github.com/posva/clipboard-text","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fclipboard-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fclipboard-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fclipboard-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fclipboard-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posva","download_url":"https://codeload.github.com/posva/clipboard-text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232615210,"owners_count":18550648,"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","clipboard","copy","text"],"created_at":"2024-10-11T09:08:11.622Z","updated_at":"2025-01-05T16:54:36.629Z","avatar_url":"https://github.com/posva.png","language":"TypeScript","funding_links":["https://github.com/sponsors/posva"],"categories":[],"sub_categories":[],"readme":"# clipboard-text [![Build Status](https://github.com/posva/clipboard-text/workflows/test/badge.svg)](https://github.com/posva/clipboard-text/actions/workflows/test.yml) [![npm package](https://badgen.net/npm/v/clipboard-text)](https://www.npmjs.com/package/clipboard-text)\n\n\u003e Simple and small copy-text-to-the-clipboard-utility with IE11 support\n\n## Installation\n\n```sh\nnpm install clipboard-text\n```\n\n## Usage\n\n```js\nimport copy from 'clipboard-text'\n\nbutton.addEventListener('click', () =\u003e {\n  copy('Hi there')\n})\n```\n\n## API\n\n### copy(text: string, parentElement?: Element): boolean\n\nCopy `text` to the clipboard.\n\nIf the event triggering the `copy` functions comes from an element with a focus\ntrap, like a Modal, you will need to provide a `parentElement`. By default,\n`parentElement` is set to `body`.\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## Related\n\n- [copy-text-to-clipboard](https://github.com/sindresorhus/copy-text-to-clipboard) -\n  Original package with no support for IE and no support for focus traps\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposva%2Fclipboard-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposva%2Fclipboard-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposva%2Fclipboard-text/lists"}