{"id":13464980,"url":"https://github.com/jhchen/fast-diff","last_synced_at":"2025-05-14T14:08:37.451Z","repository":{"id":21431587,"uuid":"24749766","full_name":"jhchen/fast-diff","owner":"jhchen","description":"A fast Javascript string diff","archived":false,"fork":false,"pushed_at":"2023-05-19T08:25:10.000Z","size":75,"stargazers_count":686,"open_issues_count":2,"forks_count":46,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-13T22:19:29.566Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-10-03T07:12:03.000Z","updated_at":"2025-05-13T03:43:09.000Z","dependencies_parsed_at":"2024-01-13T20:36:18.245Z","dependency_job_id":null,"html_url":"https://github.com/jhchen/fast-diff","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.2857142857142857,"last_synced_commit":"bc1e462881948c4d97b6103efd655b47bc4aab05"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchen%2Ffast-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchen%2Ffast-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchen%2Ffast-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchen%2Ffast-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhchen","download_url":"https://codeload.github.com/jhchen/fast-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160425,"owners_count":22024568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T14:00:53.878Z","updated_at":"2025-05-14T14:08:37.430Z","avatar_url":"https://github.com/jhchen.png","language":"JavaScript","readme":"# Fast Diff ![Build Status](https://github.com/jhchen/fast-diff/actions/workflows/test.yml/badge.svg)\n\nThis is a simplified import of the excellent [diff-match-patch](https://code.google.com/p/google-diff-match-patch/) library by [Neil Fraser](https://neil.fraser.name/) into the Node.js environment. The match and patch parts are removed, as well as all the extra diff options. What remains is incredibly fast diffing between two strings.\n\n The diff function is an implementation of [\"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.4.6927\u0026rep=rep1\u0026type=pdf) with the suggested divide and conquer strategy along with several [optimizations](http://neil.fraser.name/news/2007/10/09/) Neil added.\n\n```js\nvar diff = require('fast-diff');\n\nvar good = 'Good dog';\nvar bad = 'Bad dog';\n\nvar result = diff(good, bad);\n// [[-1, \"Goo\"], [1, \"Ba\"], [0, \"d dog\"]]\n\n// Respect suggested edit location (cursor position), added in v1.1\ndiff('aaa', 'aaaa', 1)\n// [[0, \"a\"], [1, \"a\"], [0, \"aa\"]]\n\n// For convenience\ndiff.INSERT === 1;\ndiff.EQUAL === 0;\ndiff.DELETE === -1;\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhchen%2Ffast-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhchen%2Ffast-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhchen%2Ffast-diff/lists"}