@lowlighter/diff
v4.0.0
Published
[](https://jsr.io/@libs/diff) [](https://jsr.io/@libs/diff) [](https
Readme
➕ Diff
Compute and apply unified patches, matching the unix diff/patch command line tools output.
📑 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
diffcommand line output- Compatible with the
patchandgit applytools.
- Compatible with the
- Support for applying back unified patches to strings.
- Has no external dependencies.
- Is lightweight.
📜 License and credits
Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSEThis library is based on the previous work of @jonTrent which is itself based on the work of Bram Cohen.
- The original JavaScript source code was public domain under the Unlicense
