sindresorhus/copy-text-to-clipboard
Copy text to the clipboard in modern browsers (0.2 kB) observed · 2026-08-28
Health v2 · maintenance only
66/100
- Activity 65
- Release rhythm 48
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 15
- age_days: 3390
- days_rel: 344
- days_push: 212
- n_releases_24m: 2
Adoption not part of the score
1045 stars · 222 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A tiny (0.2 kB) JavaScript library for copying text to the clipboard in modern browsers. It works in non-secure contexts where the native navigator.clipboard API is unavailable.
Use cases
- copy text to clipboard on button click in a web app
- clipboard copy fallback for non-HTTPS sites
- copy code snippets to clipboard in documentation sites
- copy text inside a modal with a focus trap
- lightweight alternative to clipboard.js
When to choose
- you need a minimal, dependency-free clipboard copy solution for the browser
- your site runs in non-secure contexts (HTTP) where navigator.clipboard is unavailable
- you need to copy text from within a focus trap like a modal
When to avoid
- you only target secure contexts and can use navigator.clipboard.writeText directly
- you need clipboard access in Node.js (use clipboardy instead)
- you need copy/paste of rich content like images or HTML
Facets
library · maturity stable
ui-components web-development frontend browser-extensions browser clipboard copy-to-clipboard tiny zero-dependency browser-api javascript
2 sources
- readme: https://github.com/sindresorhus/copy-text-to-clipboard · fetched 2026-08-28 · 12efbf45f411
- registry_npm: https://registry.npmjs.org/copy-text-to-clipboard · fetched 2026-08-29 · 41aa83d22810
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| sindresorhus/copy-text-to-clipboard | main | 66 |
For agents
markdown · JSON · MCP: product_card(name="sindresorhus/copy-text-to-clipboard")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem