https://github.com/hustcc/diff-text
Just get the diff of a simple inline text, simple mode.
https://github.com/hustcc/diff-text
diff diff-text text-diff
Last synced: about 1 month ago
JSON representation
Just get the diff of a simple inline text, simple mode.
- Host: GitHub
- URL: https://github.com/hustcc/diff-text
- Owner: hustcc
- Created: 2017-06-14T13:31:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-16T02:37:25.000Z (almost 8 years ago)
- Last Synced: 2025-02-28T19:12:08.547Z (about 2 months ago)
- Topics: diff, diff-text, text-diff
- Language: JavaScript
- Size: 3.91 KB
- Stars: 14
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# diff-text
> Inline text diff algorithm. Simplified from [https://neil.fraser.name/writing/diff/](https://neil.fraser.name/writing/diff/). For input text diff in HTML with Chinese input software.
[](https://travis-ci.org/ProtoTeam/diff-text) [](https://coveralls.io/github/ProtoTeam/diff-text)
## Usage
> **npm i --save diff-text**
```js
var diffText = require('diff-text');diffText('diff---text', 'diff+++text');
// will get array like below:
[
[0, 'diff'], // equal
[-1, '---'], // delete
[1, '+++'], // add
[0, 'text'] // equal
]
```## Test & Perf
```
> npm run test> npm run pref
diff-text x 1,238,388 ops/sec ±1.22% (88 runs sampled)
```## License
ISC@[ProtoTeam](https://github.com/ProtoTeam).