Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Black parses diff output from diff
and git diff
and provides an enumerable ruby interface for lines and metadata.
Black uses this diff interface to render a syntax-highlighted diff view in HTML.
Black isn't documented yet.
I'm getting this out for those who are compfortable diving into the source and getting some initial value from it.
Consider this a work in progress.
diff = Black::Diff.new('older string', 'newer string', 'file-name.html')
output = Black::HTMLView.render(diff: diff)
The filename determines how the content will be highlighted.
The output is HTML only. To output the css:
css = Black::Stylesheets.css({ style: :compressed })
Black uses sass, so all options are passed right into sass options. Have a look at Black::Stylesheets
for more info.
0.0.1 - Please consider the API alpha and unstable.
Black adheres to Semantic Versioning
Tested with ruby 1.9.3+
ruby 1.8.x not supported
This only supports unix-based systems at the moment.
But the shell execution is wrapped like so:
# Black::Diff.execute()
def self.execute(*command_args)
`diff #{ command_args.join(' ') }`
end
So you can reimplement this method to suit your own platform needs:
class Black::Diff
def self.execute(*command_args)
# do some custom stuff
end
end
FAQs
Unknown package
We found that black 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.