Diff
implementation of myers diff algorithm
Install / Use
/learn @Swatinem/DiffREADME
diff
implementation of myers diff algorithm
This uses the An O(ND) Difference Algorithm and Its Variations Also see http://simplygenius.net/Article/DiffTutorial2 and http://www.mathertel.de/Diff/ViewSrc.aspx for more inspiration
Installation
$ npm install diff
$ component install Swatinem/diff
Usage
diff(a, b, [eql(a, b)])
Given two arrays (or array-likes, such as strings) a and b and an optional
equal function eql, this will return an array with the following operations:
- nop the element is in both arrays
- ins the element is only in array
band will be inserted - del the element in only in array
aand will be removed - rep the element from
awill be replaced by the element fromb. This is essentially the same as a del+ins
License
LGPLv3
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR



