Documentation

πŸš€

Getting Started

Installation, basic usage, and your first diff comparison.

πŸ“š

API Reference

Complete API documentation for all diff functions.

πŸ’‘

Examples

Real-world usage examples and common patterns.

⚑

Quick Start

Get up and running with JSDiff in under 5 minutes.

// Install
npm install diff

// Import
import * as Diff from 'diff';

// Compare
const diff = Diff.diffChars('old text', 'new text');
console.log(diff);

Read full guide β†’

πŸ”§

Supported Diff Types

  • diffChars - Character by character comparison
  • diffWords - Word by word comparison
  • diffLines - Line by line comparison
  • diffJson - JSON object comparison
  • createPatch - Generate unified diff patches
  • applyPatch - Apply patches to text

View API reference β†’