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.
= Pretty Diff
A tiny library for generating pretty HTML listings for unified Diff format. Heavily used in Beanstalk (http://beanstalkapp.com) application.
== Installation
gem install pretty_diff
== Example
A quick example will tell it all:
udiff = File.read("awesome.diff") pretty = PrettyDiff::Diff.new(udiff) pretty.to_html
Wrap it with HTML, add some styles and you will get something like this:
http://rubybrothers.ru/assets/2010/1/16/pretty_diff.jpg
== Features
The library is really easy to read and change. All HTML is generated by a set of classes called generators, it's very easy to customize the output to suit your needs.
By default PrettyDiff will generate HTML that can be easily colored with the CSS that you can find in the example above.
PrettyDiff will generate 2 columns of line numbers, as it's usually done for diffs. These columns are copy/paste safe, means that line numbers won't be copied when you copy diff contents.
Tabs will be automatically converted to double spaces.
HTML tags will be automatically escaped from the input string.
== To Do
The test suit can be somewhat improved.
== History
The library was extracted from Beanstalk during the awesome Wildbit Open Source Fridays.
Read more about Open Source Fridays here:
http://wildbit.com/blog/2010/01/15/open-source-fridays-at-wildbit/
== Contributors
Copyright (c) 2010 Ilya Sabanin, Wildbit; see LICENSE for details.
FAQs
Unknown package
We found that pretty_diff 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.
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.