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.
Calculates the differences between two tree-like structures. Similar to Rubys built-in TSort module.
Diff two HTML documents:
require 'nokogiri'
require 'tdiff'
class Nokogiri::XML::Node
include TDiff
def tdiff_equal(node)
if (self.text? && node.text?)
self.text == node.text
elsif (self.respond_to?(:root) && node.respond_to?(:root))
self.root.tdiff_equal(node.root)
elsif (self.respond_to?(:name) && node.respond_to?(:name))
self.name == node.name
else
false
end
end
def tdiff_each_child(node,&block)
node.children.each(&block)
end
end
doc1 = Nokogiri::HTML('<div><p>one</p> <p>three</p></div>')
doc2 = Nokogiri::HTML('<div><p>one</p> <p>two</p> <p>three</p></div>')
doc1.at('div').tdiff(doc2.at('div')) do |change,node|
puts "#{change} #{node.to_html}".ljust(30) + node.parent.path
end
+ <p>one</p> /html/body/div
+ /html/body/div
<p>one</p> /html/body/div
/html/body/div
<p>three</p> /html/body/div
- one /html/body/div/p[1]
+ two /html/body/div/p[2]
three /html/body/div/p[2]
$ gem install tdiff
See {file:LICENSE.txt} for details.
FAQs
Unknown package
We found that tdiff demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.