@lowlighter/diff

2.0.0 • Public • Published

➕ 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.

Readme

Keywords

Package Sidebar

Install

npm i @lowlighter/diff

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

33.8 kB

Total Files

46

Last publish

Collaborators

  • lowlighter