{"id":14962605,"url":"https://github.com/ghostdevv/svelte-copy","last_synced_at":"2025-04-08T11:12:50.215Z","repository":{"id":36959422,"uuid":"435902671","full_name":"ghostdevv/svelte-copy","owner":"ghostdevv","description":"A svelte action to copy text on click!","archived":false,"fork":false,"pushed_at":"2025-01-22T07:40:37.000Z","size":431,"stargazers_count":166,"open_issues_count":4,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T10:11:13.533Z","etag":null,"topics":["hacktoberfest","svelte","sveltejs"],"latest_commit_sha":null,"homepage":"https://svelte-copy.willow.codes","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/ghostdevv.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":{"patreon":"onlyspaceghost","custom":"https://ghostdev.xyz/donate"}},"created_at":"2021-12-07T14:02:26.000Z","updated_at":"2025-01-18T23:56:51.000Z","dependencies_parsed_at":"2025-03-11T06:11:02.411Z","dependency_job_id":"d1f6ddbf-d111-4c0b-a64f-60a7372fe179","html_url":"https://github.com/ghostdevv/svelte-copy","commit_stats":{"total_commits":133,"total_committers":4,"mean_commits":33.25,"dds":"0.49624060150375937","last_synced_commit":"ea950e53f56fb6ea6cfea28db2251480e5b8fa22"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsvelte-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsvelte-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsvelte-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsvelte-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostdevv","download_url":"https://codeload.github.com/ghostdevv/svelte-copy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829511,"owners_count":21002997,"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":["hacktoberfest","svelte","sveltejs"],"created_at":"2024-09-24T13:30:08.913Z","updated_at":"2025-04-08T11:12:50.182Z","avatar_url":"https://github.com/ghostdevv.png","language":"TypeScript","readme":"# Svelte Copy\n\nA svelte action to copy text to clipboard. It uses the `navigator.clipboard` api, with a fallback to the legacy method.\n\n# Installing\n\n```sh\nnpm install svelte-copy -D\n```\n\nThis library only works with Svelte 5, checkout [svelte-copy@1](https://www.npmjs.com/package/svelte-copy/v/1.4.2) for Svelte 3/4 support.\n\n# Usage\n\nThe simplest use is to just pass the text you want to copy:\n\n```svelte\n\u003cscript\u003e\n    import { copy } from 'svelte-copy';\n\u003c/script\u003e\n\n\u003cbutton use:copy={'Hello World'}\u003e\n    Click me!\n\u003c/button\u003e\n```\n\nYou can expand that with an options object:\n\n```svelte\n\u003cscript\u003e\n    import { copy } from 'svelte-copy';\n\u003c/script\u003e\n\n\u003cbutton\n    use:copy={{\n        text,\n        events: ['click'],\n        onCopy({ text, event }) {\n            alert(`Text copied: \"${text}\". Triggered by \"${event}\"`);\n        },\n        onError({ error, event }) {\n            alert(error.message)\n        }\n    }}\n\u003e\n    Copy\n\u003c/button\u003e\n```\n\n[Read the full docs here](https://svelte-copy.willow.codes).\n\n# Migrating from v1 to v2\n\n- The `on:svelte-copy` event is now a `onCopy` param to the action options.\n- The `on:svelte-copy:error` event is now a `onError` param to the action options.\n- The `events` option now only accepts `string[]`, rather than `string | string[]`\n- Svelte 5 is now required\n\n# Support\n\n-   Join the [discord](https://discord.gg/2Vd4wAjJnm)\u003cbr\u003e\n-   Create a issue on the [github](https://github.com/ghostdevv/svelte-copy)\n","funding_links":["https://patreon.com/onlyspaceghost","https://ghostdev.xyz/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Fsvelte-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostdevv%2Fsvelte-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Fsvelte-copy/lists"}