Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T20:13:45.000Z (23 days ago)
- Last Synced: 2024-12-11T20:36:26.700Z (23 days 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: 44.9 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
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 @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
```