
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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.
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.