Gathering detailed insights and metrics for line-diff
Gathering detailed insights and metrics for line-diff
Gathering detailed insights and metrics for line-diff
Gathering detailed insights and metrics for line-diff
diff2html
Fast Diff to colorized HTML
text-diff
Compute a diff between two pieces of text with support for same-line diffs, and optionally display a visual diff as HTML. Module made from the text-diff-match-patch library.
diff-frag
Take a big diff with a 2-line header and turn it into frags with only a reasonable amount of context
lint-diff-line
:Run eslint only in the changed parts of the code
npm install line-diff
Typescript
Module System
Node Version
NPM Version
99.9
Supply Chain
100
Quality
76.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
11 Stars
42 Commits
2 Watchers
1 Branches
3 Contributors
Updated on Feb 20, 2025
Latest Version
2.1.2
Package Id
line-diff@2.1.2
Unpacked Size
13.54 kB
Size
4.92 kB
File Count
5
NPM Version
10.9.2
Node Version
23.6.0
Published on
Feb 14, 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
Compare strings line by line.
1# Using npm 2npm install --save line-diff 3 4# Using yarn 5yarn add line-diff
1const LineDiff = require("line-diff")
2 , fs = require("fs")
3
4// Show differences between the two files
5console.log(
6 new LineDiff(
7 fs.readFileSync(__dirname + "/1.txt", "utf-8")
8 , fs.readFileSync(__dirname + "/2.txt", "utf-8")
9 ).toString()
10)
11// not modified
12// - old
13// - deleted
14// -
15// - 12345
16// + new
17// + 1234
18
19console.log(
20 new LineDiff(
21 fs.readFileSync(__dirname + "/1.txt", "utf-8")
22 , fs.readFileSync(__dirname + "/2.txt", "utf-8")
23 , 3
24 ).toString()
25)
26// not modified
27// new
28// - deleted
29// -
30// - 12345
31// + 1234
There are few ways to get help:
Diff(oldLines, newLines, sensitivity)
Compares strings line by line.
oldLines
: The old lines.newLines
: The new lines.sensitivity
: A number representing how many changes should be there to consider that a line was changed (default: 0
).Diff
object containing:old_lines
(Array|String): The old lines.new_lines
(Array|String): The new lines.sensitivity
(Number): The diff sensitivity.changes
(Array): An array of Change
objects.toString
(Function): A function to stringify the diff.toString()
Converts the lines comparison into a string.
Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a
coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
@alza54/css-modules-typescript-loader
@beisen/css-modules-typescript-loader
@digibear/mush-format
@kodyl/css-modules-typescript-loader
@liutsing/css-modules-typescript-loader
@modern-js/builder-shared
@morlz/css-modules-typescript-loader
@personio/css-modules-typescript-loader
@skyleague/node-standards
css-interface-loader
css-modules-typescript-loader
diffr
pinman
rspack-css-modules-typescript-loader
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 2/15 approved changesets -- score normalized to 1
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
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
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