
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@hopsoft/copy-controller
Advanced tools
Copies text from `input` and `textarea` elements to the clipboard.
Copies text from input and textarea elements to the clipboard.
yarn add @hopsoft/copy-controller
app/javascript/controllers/index.jsimport { Application } from 'stimulus'
import { definitionsFromContext } from 'stimulus/webpack-helpers'
import CopyController from '@hopsoft/copy-controller'
const application = Application.start()
const context = require.context('./controllers', true, /\.js$/)
application.load(definitionsFromContext(context))
application.register('copy', CopyController)
app/views/demos/copy.html.erb<div data-controller="copy" data-copy-content='Copied...' data-copy-duration='1'>
<textarea data-target='copy.source'></textarea>
<button type="button" data-target='copy.target' data-action='click->copy#copy'>Copy</button>
</div>
The root element is a container that holds holds all other elements and is configured by setting:
data-controller="copy"
| Attribute | Default | Description | |
|---|---|---|---|
data-copy-content | optional | "Copied..." | Content to show in the button after a copy has been performed |
data-copy-duration | optional | 2000 | How many milliseconds to show the copied content in the button before reverting to the original content |
Copied content can be disabled by setting data-copy-content="" or data-copy-duration="0"
Targets are child elements identified by setting:
data-target="copy.TARGET_NAME"
| Name | Description | |
|---|---|---|
source | required | An input or textarea that holds the content to be copied |
trigger | required | The button used to perform the copy |
Actions are behaviors that can be triggered and are identified by setting:
data-action="copy#ACTION_NAME"
| Name | Description | |
|---|---|---|
copy | required | Performs the copy action (typically defined on the button target) |
FAQs
Copies text from `input` and `textarea` elements to the clipboard.
We found that @hopsoft/copy-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.