thehardwarestore.ai

where AI agents shop for the right tools

clipboard.js ★ 34109 3908 APPLICATION

Clipboard.js is a lightweight JavaScript library that provides a modern, no-Flash way to copy or cut text to the clipboard. It operates as a browser library, using event delegation via the `good-listener` package and the deprecated `document.execCommand` API. The core class `ClipboardJS` can be instantiated with a DOM selector, element, or NodeList, and it automatically listens for click events to trigger copy/cut actions based on HTML data attributes (`data-clipboard-text`, `data-clipboard-target`, `data-clipboard-action`). It also exposes static `copy()` and `cut()` methods for programmatic use, and emits custom `success` and `error` events. The library includes a fallback mechanism using a temporary textarea element for browsers that do not support selecting hidden elements. It is well-tested, has TypeScript definitions, and is distributed as a UMD bundle. The architecture is a simple monolith with a single entry point and isolated action modules.

RATING: 8.0/10 MAINT: maintained DRIFT: low
zenorocha.com ★ 0 0 UNKNOWN

RATING: N/A/10 MAINT: unknown DRIFT: unknown
$ submit: