{"id":21112198,"url":"https://github.com/icflorescu/textdiff-patch","last_synced_at":"2025-07-08T17:32:29.650Z","repository":{"id":146683426,"uuid":"49915254","full_name":"icflorescu/textdiff-patch","owner":"icflorescu","description":"Apply lean text diff delta patches created by textdiff-create.","archived":false,"fork":false,"pushed_at":"2024-04-20T08:00:54.000Z","size":215,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-01T01:04:56.782Z","etag":null,"topics":["diff","javascript","nodejs","text-diff"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icflorescu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"icflorescu"}},"created_at":"2016-01-19T00:37:45.000Z","updated_at":"2024-04-20T08:00:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff1b8aff-29cf-4903-97c5-78a35419007d","html_url":"https://github.com/icflorescu/textdiff-patch","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icflorescu%2Ftextdiff-patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icflorescu%2Ftextdiff-patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icflorescu%2Ftextdiff-patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icflorescu%2Ftextdiff-patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icflorescu","download_url":"https://codeload.github.com/icflorescu/textdiff-patch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225452404,"owners_count":17476564,"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":["diff","javascript","nodejs","text-diff"],"created_at":"2024-11-20T01:27:06.099Z","updated_at":"2024-11-20T01:27:06.568Z","avatar_url":"https://github.com/icflorescu.png","language":"JavaScript","readme":"# textdiff-patch\n\n[![NPM version][npm-image]][npm-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n[![Sponsor the author][sponsor-image]][sponsor-url]\n\n![textdiff-patch](https://cloud.githubusercontent.com/assets/581999/12406663/c3e3c7d4-be57-11e5-8aad-a92d86c79b05.png)\n\nThis is a simple module for applying **lean text diff delta patches** created by [textdiff-create](https://github.com/icflorescu/textdiff-create).\n\n## ❤️🇺🇦\n\nSee [below](#stand-with-ukraine).\n\n## Usage\n\nAssuming you've correctly installed the `npm` module with `npm i textdiff-patch [--save|--save-dev]`:\n\n    const applyPatch = require('textdiff-patch');\n\n    const v1 = 'The sleepy brown fox';\n    const delta = [\n          [0, 4],\n          [-1, 6],\n          [1, 'quick'],\n          [0, 10],\n          [1, ' jumps over the lazy dog']\n        ];\n\n    const v2 = applyPatch(v1, delta);\n\n    console.log(v2);\n\nThe script will produce the following output:\n\n    The quick brown fox jumps over the lazy dog\n\n## Additional info\n\nHave a look at [textdiff-create](https://github.com/icflorescu/textdiff-create) for more info.\n\n## Credits \u0026 support\n\nIf you find this piece of software useful, please star the repo, [spread the word](http://twitter.com/share?text=Apply%20lean%20text%20diff%20patches%20in%20JavaScript\u0026url=https%3A%2F%2Fgithub.com%2Ficflorescu%2Ftextdiff-patch\u0026hashtags=javascript%2Cnodejs%2Cnpm\u0026via=icflorescu), [sponsor my work](https://github.com/sponsors/icflorescu) and feel free to endorse me on LinkedIn:\n\n[![Ionut-Cristian Florescu on LinkedIn](https://static.licdn.com/scds/common/u/img/webpromo/btn_viewmy_160x25.png)](https://www.linkedin.com/in/icflorescu)\n\n## Stand with Ukraine\n\nOn 24th of February 2022 [Russia unlawfully invaded Ukraine](https://en.wikipedia.org/wiki/Russo-Ukrainian_War). This is an unjustified, unprovoked attack on the sovereignty of a neighboring country, but also an open affront to international peace and stability that has the potential to degenerate into a nuclear event threatening the very existence of humanity. I am a Romanian (EU) citizen, but I stand with Ukraine and I am doing everything in my power to stop this madness. Here's [how you can show your support](https://www.stopputin.net/).\n\n## LICENSE\n\nReleased under [ISC](https://github.com/icflorescu/textdiff-patch/blob/master/LICENSE).\n\n[npm-image]: https://img.shields.io/npm/v/textdiff-patch.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/textdiff-patch\n[license-image]: http://img.shields.io/npm/l/textdiff-patch.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/textdiff-patch.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/textdiff-patch\n[sponsor-image]: https://img.shields.io/badge/sponsor-violet?style=flat-square\n[sponsor-url]: https://github.com/sponsors/icflorescu\n","funding_links":["https://github.com/sponsors/icflorescu"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficflorescu%2Ftextdiff-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficflorescu%2Ftextdiff-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficflorescu%2Ftextdiff-patch/lists"}