You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,9 @@
3
3
4
4
# node-diff3
5
5
6
-
This is a Javascript library for text diffing and three-way-merge.
6
+
**node-diff3** is a Javascript library to find differences between two buffers, generate and apply patches, and perform 3-way merging between an original and two changed buffers. It contains similar functionality to the [GNU Diffutils](https://www.gnu.org/software/diffutils/manual/diffutils.html) tools.
7
7
8
-
The code originally came from project Synchrotron, created by Tony Garnock-Jones.
9
-
For more detail please visit:
8
+
The code originally came from project Synchrotron, created by Tony Garnock-Jones. For more detail please visit:
To install node-diff3 as a dependency in another project:
17
+
To install node-diff3 as a dependency in your project:
19
18
```bash
20
19
$ npm install --save node-diff3
21
20
```
22
21
23
-
This library is distributed in both UMD and ES6 module formats for maxmimum compatibility. <sub>([read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm))</sub>
22
+
**node-diff3**is distributed in both UMD and ES6 module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm))
24
23
*`index.mjs` - ES6 module
25
24
*`dist/index.js` - UMD module, ES6 syntax
26
25
*`dist/index.es5.js` - UMD module, ES5 syntax
@@ -35,7 +34,7 @@ import * as Diff3 from 'node-diff3'; // ES6 import all
35
34
import { diff3Merge } from'node-diff3'; // ES6 import named
36
35
```
37
36
38
-
You can also use node-diff3 directly in a web browser. A good way to do this is to fetch the file from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions:
37
+
You can also use **node-diff3** directly in a web browser. A good way to do this is to fetch the file from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions.
39
38
40
39
The latest versions of many web browsers now support [ES6 modules in script tags](https://caniuse.com/#feat=es6-module) like this:
41
40
```html
@@ -79,7 +78,7 @@ Or if you need to support even older browsers like Internet Explorer, fetch the
Performs a 3-way diff on buffers `o` (original), `a`, and `b`.
81
+
Performs a 3-way diff on buffers `o` (original), and `a` and `b` (changed).
83
82
The buffers may be arrays or strings. If strings, they will be split into arrays on whitespace `/\s+/` by default.
84
83
The returned result alternates between "ok" and "conflict" blocks.
85
84
@@ -100,7 +99,7 @@ Options may passed as an object:
100
99
}
101
100
```
102
101
103
-
*`excludeFalseConflicts` - If both `a` and `b` contain the same change from `o`, this is considered a "false" conflict.
102
+
*`excludeFalseConflicts` - If both `a` and `b` contain an identical change from `o`, this is considered a "false" conflict.
104
103
*`stringSeparator` - If inputs buffers are strings, this controls how to split the strings into arrays. The separator value may be a string or a regular expression, as it is just passed to [String.split()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split).
0 commit comments