Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
svelte-copy
Advanced tools
Ever wanted to copy something to clipboard? Say hello to Svelte Copy ✨
npm install svelte-copy -D
Let's make a button that when you click it copies Hello World
to the clipboard:
<script>
import { copy } from 'svelte-copy';
</script>
<button use:copy={"Hello World"}>
Click me!
</button>
There are some custom events you can use on elements that have the copy action:
on:svelte-copy
This will fire when text is copied, you have access to the copied text if needed with event.detail
:
<button
use:copy={'Hello from alert'}
on:svelte-copy={(event) => alert(event.detail)}>
Click to cause alert on copy
</button>
on:svelte-copy:error
This event will fire if there is an error in copying to clipboard, you have access to the error with event.detail
:
<button
use:copy={'Some text'}
on:svelte-copy:error="{(event) =>
alert(`There was an error: ${event.detail.message}`)}">
Click to cause alert on copy
</button>
FAQs
A svelte action to copy text to clipboard. It uses the `navigator.clipboard` api, with a fallback to the legacy method.
The npm package svelte-copy receives a total of 2,878 weekly downloads. As such, svelte-copy popularity was classified as popular.
We found that svelte-copy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.