https://github.com/onesy-me/diff
Difference algorithm
https://github.com/onesy-me/diff
algorithm algorithms amaui browser diff diff-algorithm difference difference-algorithm javascript js library myers-algorithm node nodejs typescript utils web
Last synced: 10 days ago
JSON representation
Difference algorithm
- Host: GitHub
- URL: https://github.com/onesy-me/diff
- Owner: onesy-me
- License: mit
- Created: 2022-02-08T05:40:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-29T20:38:03.000Z (8 months ago)
- Last Synced: 2025-10-04T06:00:00.726Z (7 months ago)
- Topics: algorithm, algorithms, amaui, browser, diff, diff-algorithm, difference, difference-algorithm, javascript, js, library, myers-algorithm, node, nodejs, typescript, utils, web
- Language: TypeScript
- Homepage: https://docs.onesy.me/library/diff
- Size: 62.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
onesy Diff
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:
### Add
```sh
yarn add @onesy/diff
```
### Use
```javascript
import OnesyDiff from '@onesy/diff';
// Make a new OnesyDiff instance
// with an optional initial value for options
const onesyDiff = new OnesyDiff();
// Diff
const diff = onesyDiff.diff('aaa', 'aab');
// {
// items: ['r', 2, 'a', 2, 'b']
// }
// Update
onesyDiff.update('aaa', diff);
// 'aab'
```
### Dev
Install
```sh
yarn
```
Test
```sh
yarn test
```
### Prod
Build
```sh
yarn build
```