diff-view
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

Introduction

Calculates and visualises differences between textual files. Uses teh popular 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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.12
    0
    • latest

Version History

Package Sidebar

Install

npm i diff-view

Weekly Downloads

0

Version

1.0.12

License

MIT

Last publish

Collaborators

  • tomitrescak