kpdecker / jsdiff

A javascript text differencing implementation.
BSD 3-Clause "New" or "Revised" License
7.69k stars 491 forks source link

A simple few-line example of what to import? #520

Open Pomax opened 1 month ago

Pomax commented 1 month ago

The readme convers how to install it, and the API that you get on the Diff object, but it seems to be missing the part in between those two on how to actually import the thing you'll be working with. Even just a seemingly silly sentence like:

then import the diffing object using import Diff from "diff";

would fill the gap that currently exists =)

(because is it import Diff? import { Diff }? import diff from "diff"; const Diff = diff.newDiff()? Most folks can guess at what it should be of course, especially with typehint aware editors, but they shouldn't need to guess =)