{"id":705,"url":"https://github.com/sindresorhus/clipboardy","last_synced_at":"2025-05-14T01:03:15.120Z","repository":{"id":41384239,"uuid":"75538424","full_name":"sindresorhus/clipboardy","owner":"sindresorhus","description":"Access the system clipboard (copy/paste)","archived":false,"fork":false,"pushed_at":"2023-10-23T08:10:40.000Z","size":561,"stargazers_count":1837,"open_issues_count":17,"forks_count":65,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-05T18:37:42.455Z","etag":null,"topics":[],"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/sindresorhus.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":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2016-12-04T13:14:35.000Z","updated_at":"2025-04-30T18:20:50.000Z","dependencies_parsed_at":"2024-02-08T19:22:36.640Z","dependency_job_id":"3898769b-1e22-48c5-86c2-d2444fa1fd42","html_url":"https://github.com/sindresorhus/clipboardy","commit_stats":{"total_commits":66,"total_committers":15,"mean_commits":4.4,"dds":"0.40909090909090906","last_synced_commit":"06110f3e1a0cbf66dc86c87cf87d28fba772b7a1"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fclipboardy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fclipboardy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fclipboardy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fclipboardy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/clipboardy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831255,"owners_count":21810783,"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":[],"created_at":"2024-01-05T20:15:29.264Z","updated_at":"2025-05-14T01:03:11.500Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["命令行","JavaScript","Packages","系统","Repository","包","others","Uncategorized","目录","Npm","Miscellaneous","Libraries","Helpful"],"sub_categories":["redux 扩展","Miscellaneous","Shell","其他","Uncategorized","macros","运维\\\u0026DevOps","杂项"],"readme":"# clipboardy\n\n\u003e Access the system clipboard (copy/paste)\n\nCross-platform. Supports: macOS, Windows, Linux, OpenBSD, FreeBSD, Android with [Termux](https://termux.com/), and [modern browsers](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#Browser_compatibility).\n\n## Install\n\n```sh\nnpm install clipboardy\n```\n\n## Usage\n\n```js\nimport clipboard from 'clipboardy';\n\nclipboard.writeSync('🦄');\n\nclipboard.readSync();\n//=\u003e '🦄'\n```\n\n## API\n\nIn the browser, it requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).\n\n### clipboard\n\n#### .write(text)\n\nWrite (copy) to the clipboard asynchronously.\n\nReturns a `Promise`.\n\n##### text\n\nType: `string`\n\nThe text to write to the clipboard.\n\n#### .read()\n\nRead (paste) from the clipboard asynchronously.\n\nReturns a `Promise`.\n\n#### .writeSync(text)\n\nWrite (copy) to the clipboard synchronously.\n\n**Doesn't work in browsers.**\n\n##### text\n\nType: `string`\n\nThe text to write to the clipboard.\n\n#### .readSync()\n\nRead (paste) from the clipboard synchronously.\n\n**Doesn't work in browsers.**\n\n## FAQ\n\n#### Where can I find the source of the bundled binaries?\n\nThe [Linux binary](fallbacks/linux/xsel) is just a bundled version of [`xsel`](https://linux.die.net/man/1/xsel). The source for the [Windows binary](fallbacks/windows/clipboard_x86_64.exe) can be found [here](https://github.com/sindresorhus/win-clipboard).\n\n## Related\n\n- [clipboard-cli](https://github.com/sindresorhus/clipboard-cli) - CLI for this module\n- [copy-text-to-clipboard](https://github.com/sindresorhus/copy-text-to-clipboard) - Copy text to the clipboard in the browser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fclipboardy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fclipboardy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fclipboardy/lists"}