Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
org.webjars.npm:react-zeroclipboard
Advanced tools
This is a wrapper around ZeroClipboard for use with React. ZeroClipboard has a difficult to work with api which is being abstracted from you. This library...
This is only available through npm, it should work with browserify or webpack. It's compatible with react 0.13.
npm install --save react-zeroclipboard@1
Or for react 0.11 and 0.12
npm install --save react-zeroclipboard@0.4
Also install react if you haven't already (of course).
Here's a simple example:
render: function(){
return (
<div>
<p>Click the button to copy some text</p>
<ReactZeroClipboard text="Hello, world!">
<button>Copy</button>
</ReactZeroClipboard>
</div>
)
}
The full api offers more flexibility. If you provide e.g. html and text, they'll both be set and the application you're pasting into decides which one to use. Methods have higher priority than the literal strings, if for some reason you pass both.
<ReactZeroClipboard
text="text to copy"
html="<b>html to copy</b>"
richText="{\\rtf1\\ansi\n{\\b rich text to copy}}"
getText={(Void -> String)}
getHtml={(Void -> String)}
getRichText={(Void -> String)}
onCopy={(Event -> Void)}
onAfterCopy={(Event -> Void)}
onErrorCopy={(Error -> Void)}
onReady={(Event -> Void)}
/>
Here's an example where we copy the current url to the clipboard, both in plain text and a html anchor
If the user pastes this in their address bar they get the url, and if they paste it in gmail they get a nice link.
render: function(){
return (
<div>
<p>Copy a link to this page</p>
<ReactZeroClipboard
getText={function(){ return location.href; }}
getHtml={function(){ return '<a href="' + location.href + '">My Page</a>'; }}>
<button>Copy</button>
</ReactZeroClipboard>
</div>
)
}
FAQs
WebJar for react-zeroclipboard
We found that org.webjars.npm:react-zeroclipboard demonstrated a not healthy version release cadence and project activity because the last version was released 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.