Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amaui-org/amaui-diff

Difference algorithm
https://github.com/amaui-org/amaui-diff

algorithm algorithms amaui browser diff diff-algorithm difference difference-algorithm javascript js library myers-algorithm node nodejs typescript utils web

Last synced: about 2 months ago
JSON representation

Difference algorithm

Awesome Lists containing this project

README

        



amaui logo

amaui Diff


Own implementation of The Myers Difference Algorithm



MIT license    
Production ready    
UMD 3.1kb gzipped    
100% test cov    
Browser and Nodejs


Very simple code    
Modern code    
Junior friendly    
Typescript    
Made with :yellow_heart:


## Getting started

### Add

```sh
yarn add @amaui/diff
```

### Use

```javascript
import AmauiDiff from '@amaui/diff';

// Make a new AmauiDiff instance
// with an optional initial value for options
const amauiDiff = new AmauiDiff();

// Diff
const diff = amauiDiff.diff('aaa', 'aab');

// {
// items: ['r', 2, 'a', 2, 'b']
// }

// Update
amauiDiff.update('aaa', diff);

// 'aab'
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

### Prod

Build

```sh
yarn build
```