
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
diff2html-cli
Advanced tools
Diff to Html generates pretty HTML diffs from unified and git diff output in your terminal
Unified diff and Git diff input
line-by-line
and side-by-side
diff
new and old line numbers
inserted and removed lines
GitHub like style
Code syntax highlight
Line similarity matching
Go to Diff2HTML
Manually download and import rtfpessoa/diff2html/dist/diff2html.min.js
into your page
npm install -g diff2html-cli
Usage: diff2html [options] -- [diff args]
flag | alias | description | choices | default |
---|---|---|---|---|
-s | --style | Output style | line , side | line |
--sc | --synchronisedScroll | Synchronised horizontal scroll | enabled , disabled | enabled |
--su | --summary | Show files summary | closed , open , hidden | closed |
--lm | --matching | Diff line matching type | lines , words , none | none |
--lmt | --matchWordsThreshold | Diff line matching word threshold | 0.25 | |
--lmm | --matchingMaxComparisons | Diff line matching maximum line comparisons of a block of changes | 2500 | |
--hwt | --htmlWrapperTemplate | Path to custom template to be rendered when using the html output format | [string] | |
-f | --format | Output format | html , json | html |
-d | --diff | Diff style | word , char | word |
-i | --input | Diff input source | file , command , stdin | command |
-o | --output | Output destination | preview , stdout | preview |
-u | --diffy | Upload to diffy.org | browser , pbcopy , print | |
-F | --file | Send output to file (overrides output option) | [string] | |
--ig | --ignore | Ignore particular files from the diff | [string] | |
-v | --version | Show version number | ||
-h | --help | Show help |
Examples:
diff2html -s line -f html -d word -i command -o preview -- -M HEAD~1
diff2html -i file -- my-file-diff.diff
diff -u file1.txt file2.txt | diff2html -i stdin
diff2html -f json -o stdout -- -M HEAD~1
diff2html -F my-pretty-diff.html -- -M HEAD~1
diff2html -F my-pretty-diff.html --hwt my-custom-template.html -- -M HEAD~1
<!--diff2html-css-->
- writes default CSS to page<!--diff2html-js-ui-->
- writes default JavaScript UI scripts to page//diff2html-fileListCloseable
- writes code to support selected list interaction, must be within a <script>
block//diff2html-synchronisedScroll
- writes code to support selected scroll interaction, must be within a <script>
block<!--diff2html-diff-->
- writes diff content to pagediff2html --ig package-lock.json --ig yarn.lock
package-lock.json
and yarn.lock
from the generated diffNOTE: notice the --
in the examples
This is a developer friendly project, all the contributions are welcome.
To contribute just send a pull request with your changes following the guidelines described in CONTRIBUTING.md
.
I will try to review them as soon as possible.
Make some changes and then node src/main.js
😉
Copyright 2014-2019 Rodrigo Fernandes. Released under the terms of the MIT license.
This project is inspired in pretty-diff by Scott González.
FAQs
Fast Diff to colorized HTML
The npm package diff2html-cli receives a total of 0 weekly downloads. As such, diff2html-cli popularity was classified as not popular.
We found that diff2html-cli 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.