https://github.com/tomitrescak/meteor-diff
Simpel diff library to compare two text files
https://github.com/tomitrescak/meteor-diff
Last synced: 3 months ago
JSON representation
Simpel diff library to compare two text files
- Host: GitHub
- URL: https://github.com/tomitrescak/meteor-diff
- Owner: tomitrescak
- Created: 2015-02-09T06:46:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T10:11:00.000Z (11 months ago)
- Last Synced: 2025-02-06T19:03:55.139Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
Calculates and visualises differences between textual files. Uses teh popular [JSDifflib](https://github.com/cemerick/jsdifflib). Outputs either as HTML or plain text in Github style.
# Examples
To calculate **deltas** for two files:
```
var a = ' a\
b\
c'var b = ' d\
b'
```## HTML output
```
DiffView.compare(a, b)
```for **side by side** configuration outputs:
| | Old text | | New text |
| ---- | -------- | ---- | -------- |
| 1 | a | 1 | d |
| 2 | b | 2 | b |
| 3 | c | | |and for the **inline** configuration outputs
| | | Text |
| ---- | ---- | -------- |
| 1 | | a |
| | 1 | d |
| 2 | 2 | b |
| 3 | | c## Textual output
```
console.log(DiffViewSimple.compare(a, b));
```outputs
```
- (1,) a
+ (,1) d
- (3,) c
```To see the more examples and options please see the original [documentation](https://github.com/cemerick/jsdifflib)