
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
node-diff3
Advanced tools
This is a node.js library for text diffing and three-way-merge. It originally come from project Synchrotron, created by Tony Garnock-Jones.
This is a node.js library for text diffing and three-way-merge. It originally come from project Synchrotron, created by Tony Garnock-Jones. For more detail please visit: http://homepages.kcbbs.gen.nz/tonyg/projects/synchrotron.html.
patch: function (file, patch)
Applies a patch to a file.
Given file1 and file2, diff.patch(file1, diff.diffPatch(file1, file2)) should give file2.
diffIndices: function(file1, file2)
We apply the LCS to give a simple representation of the offsets and lengths of mismatched chunks in the input files. This is used by diff3MergeIndices below.
diff3MergeIndices: function (a, o, b)
Given three files, A, O, and B, where both A and B are independently derived from O, returns a fairly complicated internal representation of merge decisions it's taken. The interested reader may wish to consult
Sanjeev Khanna, Keshav Kunal, and Benjamin C. Pierce. "A Formal Investigation of Diff3." In Arvind and Prasad, editors, Foundations of Software Technology and Theoretical Computer Science (FSTTCS), December 2007.
diff3Merge: function (a, o, b, excludeFalseConflicts)
Applies the output of diff.diff3MergeIndices to actually construct the merged file; the returned result alternates between "ok" and "conflict" blocks.
merge: function (a, o, b)
build a merge file.
mergeDigIn: function (a, o, b)
build a digin style merge file.
FAQs
A JavaScript module for text diffing and three-way-merge.
The npm package node-diff3 receives a total of 99,948 weekly downloads. As such, node-diff3 popularity was classified as popular.
We found that node-diff3 demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.