JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 80698
  • Score
    100M100P100Q165332F
  • License MIT

A node.js module for text diffing and three-way-merge.

Package Exports

  • node-diff3

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-diff3) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status Coverage Status Greenkeeper badge

node-diff3

This is a node.js library for text diffing and three-way-merge.

It originally came from project Synchrotron, created by Tony Garnock-Jones. For more detail please visit:

Usage

  • 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.

    (http://www.cis.upenn.edu/~bcpierce/papers/diff3-short.pdf)

  • 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.