/monaco-diff

Text diff library exported from monaco-editor-core, which is core of VS Code.

Primary LanguageTypeScriptMIT LicenseMIT

monaco-diff

npm npm bundle size check

Text diff library exported from monaco-editor-core, which is core of VS Code.

Install

npm install monaco-diff

Usage

import { diff, linesDiff } from "monaco-diff";

console.log(
  diff(
    "just some text\n\nHello World\n\nSome more text".split("\n"),
    "just some Text\n\nHello World\n\nSome more changes".split("\n")
  )
);

console.log(
  linesDiff(
    "just some text\n\nHello World\n\nSome more text".split("\n"),
    "just some Text\n\nHello World\n\nSome more changes".split("\n")
  )
);