Skip to content

print

Iterate over a diff generating formatted text output.

Signature

ts
class Diff {
  print(options?: DiffPrintOptions | null): string;
}

Parameters

  • optionsnull | DiffPrintOptions

    Print options for diff.

    • formatDiffFormat

      Possible output formats for diff data.

      - Patch: Full git diff (default)
      - PatchHeader : Just the headers of the patch
      - Raw : Like git diff --raw the headers of the patch
      - NameOnly : Like git diff --name-only
      - NameStatus : Like git diff --name-status
      - PatchId : git diff as used by git patch-id

Returns

  • string

    Formatted text output.

Released under the MIT License.