
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
A diff utility with highlighted output for CLIs
cli-diff
makes it easy for your CLI or script to output a highlighted diff.
It doesn’t support syntax highlighting in the diff right now,
but it does support highlighting line-by-line.
$ yarn add cli-diff
$ # or npm:
$ npm install cli-diff
import diff from 'cli-diff'
// or, if you prefer:
const diff = require('cli-diff').default
console.log(diff('hello', 'goodbye'))
/* output:
@@ -1,1 +1,1 @@
-hello
\ No newline at end of file
+goodbye
*/
console.log(
diff(
{ name: 'old.txt', content: 'hello\nworld\n' },
{ name: 'new.txt', content: 'Hello, world!\n' }
)
)
/* output:
--- old.txt
+++ new.txt
@@ -1,2 +1,1 @@
-hello
-world
+Hello, world!
*/
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2018 Jed Fox
v1.0.0
Initial version 🚀
FAQs
A diff utility with highlighted output for CLIs
We found that cli-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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.