
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
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
The npm package cli-diff receives a total of 848 weekly downloads. As such, cli-diff popularity was classified as not popular.
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.