{"id":22703554,"url":"https://github.com/shrpne/clipbrd","last_synced_at":"2025-04-13T09:42:42.748Z","repository":{"id":57200432,"uuid":"142362444","full_name":"shrpne/clipbrd","owner":"shrpne","description":"Lightweight copy to clipboard for modern browsers","archived":false,"fork":false,"pushed_at":"2024-08-29T10:02:13.000Z","size":89,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T10:42:02.033Z","etag":null,"topics":["browser","clipboard","copy","javascript","support"],"latest_commit_sha":null,"homepage":null,"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/shrpne.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}},"created_at":"2018-07-25T23:06:30.000Z","updated_at":"2025-01-13T16:01:54.000Z","dependencies_parsed_at":"2022-09-16T15:11:20.262Z","dependency_job_id":null,"html_url":"https://github.com/shrpne/clipbrd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrpne%2Fclipbrd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrpne%2Fclipbrd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrpne%2Fclipbrd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shrpne%2Fclipbrd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shrpne","download_url":"https://codeload.github.com/shrpne/clipbrd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248693782,"owners_count":21146861,"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","javascript","support"],"created_at":"2024-12-10T08:11:14.753Z","updated_at":"2025-04-13T09:42:42.702Z","avatar_url":"https://github.com/shrpne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clipbrd\n\n[![NPM Package](https://img.shields.io/npm/v/clipbrd.svg?style=flat-square)](https://www.npmjs.org/package/clipbrd)\n[![Minified Size](https://img.shields.io/bundlephobia/min/clipbrd.svg?style=flat-square)](https://bundlephobia.com/result?p=clipbrd)\n[![Build Status](https://img.shields.io/travis/com/shrpne/clipbrd/master.svg?style=flat-square)](https://travis-ci.com/shrpne/clipbrd)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://github.com/shrpne/clipbrd/blob/master/LICENSE)\n\nLightweight module to copy text to the clipboard in modern browsers *(\u003c 1kB minified)*\n\n[Demo JSFiddle](https://jsfiddle.net/shrpne/eyw596nz/)\n\n\n## Install\n\n```\nnpm install clipbrd\n```\n\n\n## Usage\n\n```js\nimport * as clipboard from 'clipbrd';\n\nif (clipboard.isSupported()) {\n    button.addEventListener('click', () =\u003e {\n        clipboard.copy('Custom text');\n    });\n}\n```\n\n\n## API\n\n### copy(text)\n\nCopy `text` to the clipboard.\n\nReturns a `boolean` of whether it succeeded.\n\nMust be called in response to a user gesture event, like `click` or `keyup`.\n\n### isSupported()\n\nCheck if copy is supported, that way you can hide copy buttons from the UI.\n\nReturns a `boolean`\n\n\n## Reference\n\n- [hackernoon.com/copying-text-to-clipboard-with-javascript](https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f) - Original Hackernoon article\n- [copy-text-to-clipboard](https://github.com/sindresorhus/copy-text-to-clipboard) - Pulled fixes from battle tested realization\n- [clipboard.js](https://github.com/zenorocha/clipboard.js/) - Pulled support method\n\n\n## License\n\nMIT License\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshrpne%2Fclipbrd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshrpne%2Fclipbrd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshrpne%2Fclipbrd/lists"}