Skip to main content

@libs/diff@3.0.2
Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads145/wk
Published4 months ago (3.0.2)

➕ Diff (patience algorithm)

➕ Diff

JSR JSR Score NPM Coverage

Use the patience algorithm for practical purposes.

📑 Examples

import { diff } from "./diff.ts"
diff("foo\n", "foo")
--- a
+++ b
@@ -1 +1 @@
-foo
+foo
\ No newline at end of file

✨ Features

  • Support for computing the unified patch between two strings.
  • Support for matching the diff command line output.
  • Has no external dependencies.
  • Is lightweight.

📜 License and credits

Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSE

This library is based on the previous work of @jonTrent which is itself based on the work of Bram Cohen.

Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@libs/diff

Import symbol

import * as diff from "@libs/diff";
or

Import directly with a jsr specifier

import * as diff from "jsr:@libs/diff";