Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 853 Bytes

File metadata and controls

50 lines (33 loc) · 853 Bytes

diff-kit examples

Build the package first so the examples can import from ../dist.

pnpm build

Core examples

Run line diff, chunking, and stats:

pnpm exec tsx examples/line-diff.ts

Run character-level diff:

pnpm exec tsx examples/character-diff.ts

Run a more detailed character diff report with grouped inserted and removed runs:

pnpm exec tsx examples/character-diff-report.ts

The older starter examples are still available:

pnpm exec tsx examples/hello.ts
pnpm exec tsx examples/string.ts

React examples

These render the React components to static HTML with react-dom/server.

Run DiffStats and DiffViewer:

pnpm exec tsx examples/react-diff-viewer.tsx

Run DiffChars and DiffCharsRaw:

pnpm exec tsx examples/react-character-diff.tsx