Gathering detailed insights and metrics for diffable-html
Gathering detailed insights and metrics for diffable-html
Gathering detailed insights and metrics for diffable-html
Gathering detailed insights and metrics for diffable-html
@types/diffable-html
TypeScript definitions for diffable-html
gulp-diffable-html
gulp plugin formatting html via diffable-html.
@bundled-es-modules/diffable-html
mirror of diffable-html, bundled and exposed as ES module
quifacilis
Opinionated HTML formatter focused towards making HTML diffs readable.
Opinionated HTML formatter focused towards making HTML diffs readable.
npm install diffable-html
Typescript
Module System
Node Version
NPM Version
JavaScript (84%)
Shell (16%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
39 Stars
67 Commits
10 Forks
49 Watchers
12 Branches
264 Contributors
Updated on Jul 02, 2025
Latest Version
6.0.1
Package Id
diffable-html@6.0.1
Unpacked Size
9.29 kB
Size
3.25 kB
File Count
3
NPM Version
10.2.3
Node Version
20.10.0
Published on
Feb 17, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
This formatter will normalize your HTML in a way that when you diff it, you get a clear sense of what changed.
This is a "zero-config" and opinionated HTML formatter. Default rules might change in future releases in which case we will push a major release.
Feel free to open issues to discuss better defaults.
Formatting consists of:
Be aware that this plugin is intended for making HTML diffs more readable. We took the compromise of not dealing with white-spaces like the browsers do.
Add the package as a dev-dependency:
1# With npm 2npm install --save-dev diffable-html 3 4# With yarn 5yarn add --dev diffable-html
1import toDiffableHtml from 'diffable-html'; 2 3const html = ` 4<div id="header"> 5 <h1>Hello World!</h1> 6 <ul id="main-list" class="list"><li><a href="#">My HTML</a></li></ul> 7</div> 8` 9 10console.log(toDiffableHtml(html));
Will output:
1<div id="header"> 2 <h1> 3 Hello World! 4 </h1> 5 <ul 6 id="main-list" 7 class="list" 8 > 9 <li> 10 <a href="#"> 11 My HTML 12 </a> 13 </li> 14 </ul> 15</div>
This formatter was initially developed to address the lack of some features in js-beautifier:
These features are needed to improve readability of HTML diffs.
Development of this plugin was motivated by making testing of Vue.js components easier by the use of Jest with snapshot tests.
You can find a serializer for formatting your HTML here Jest serializer.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 9/10 approved changesets -- score normalized to 9
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More