{"id":24063337,"url":"https://github.com/amweiss/angular-diff-match-patch","last_synced_at":"2025-05-16T05:00:24.902Z","repository":{"id":20202841,"uuid":"23474243","full_name":"amweiss/angular-diff-match-patch","owner":"amweiss","description":"An AngularJS wrapper for google-diff-match-patch","archived":false,"fork":false,"pushed_at":"2025-05-05T07:16:55.000Z","size":3199,"stargazers_count":138,"open_issues_count":4,"forks_count":34,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-05T08:26:43.148Z","etag":null,"topics":["angular","diff","javascript","wrapper"],"latest_commit_sha":null,"homepage":"https://amweiss.github.io/angular-diff-match-patch/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amweiss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-08-29T18:49:34.000Z","updated_at":"2025-05-05T07:16:59.000Z","dependencies_parsed_at":"2023-10-23T07:32:41.556Z","dependency_job_id":"2ec36fd0-7dce-407d-a1d1-8ac7a253fc4d","html_url":"https://github.com/amweiss/angular-diff-match-patch","commit_stats":{"total_commits":596,"total_committers":21,"mean_commits":28.38095238095238,"dds":0.6560402684563759,"last_synced_commit":"716538fbae1370d7e4e359155674fc415983e1be"},"previous_names":[],"tags_count":80,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amweiss%2Fangular-diff-match-patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amweiss%2Fangular-diff-match-patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amweiss%2Fangular-diff-match-patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amweiss%2Fangular-diff-match-patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amweiss","download_url":"https://codeload.github.com/amweiss/angular-diff-match-patch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"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":["angular","diff","javascript","wrapper"],"created_at":"2025-01-09T09:37:28.652Z","updated_at":"2025-05-16T05:00:24.855Z","avatar_url":"https://github.com/amweiss.png","language":"JavaScript","readme":"angular-diff-match-patch\n========================\n\n[![npm](https://img.shields.io/npm/v/angular-diff-match-patch.svg)](https://www.npmjs.com/package/angular-diff-match-patch)\n[![CircleCI](https://img.shields.io/circleci/project/github/amweiss/angular-diff-match-patch/master.svg)](https://circleci.com/gh/amweiss/angular-diff-match-patch/tree/master) [![Codecov](https://img.shields.io/codecov/c/github/amweiss/angular-diff-match-patch.svg?maxAge=2592000)](https://codecov.io/gh/amweiss/angular-diff-match-patch)\n\nThis library is simply a wrapper around [google-diff-match-patch](https://code.google.com/p/google-diff-match-patch/).\n\n![Simple](https://i.imgur.com/C2B0pdK.png)\n\n(Shown here with some custom styles)\n\nAngular 2 Port\n---------------\n\nShould you wish to use this in an Angular 2+ project, take a look at this port: [elliotforbes/ng-diff-match-patch](https://github.com/elliotforbes/ng-diff-match-patch)\n\nSetup\n-----\n\nInstall from [NPM](https://npmjs.com)\n\n`npm install amweiss/angular-diff-match-patch`\n\nInstall from [Bower](https://bower.io/)\n\n`bower install angular-diff-match-patch`\n\nUsage with webpack\n\n```javascript\n  config.plugins = [\n    new webpack.ProvidePlugin({\n      diff_match_patch: 'diff-match-patch'\n    }),\n  ];\n```\n\nUsage\n-----\n\nSee [the included demo](https://amweiss.github.io/angular-diff-match-patch/) for reference or view a sample on [Codepen](https://codepen.io/amweiss/pen/grXNPm).\n\n```html\n\u003cpre line-diff left-obj=\"left\" right-obj=\"right\"\u003e\u003c/pre\u003e\n```\n\nWhere `left` and `right` are defined on your scope.  The `options` attribute can be used as well, but it's optional.\n\n```javascript\n$scope.options = {\n  editCost: 4,\n  attrs: {\n    insert: {\n      'data-attr': 'insert',\n      'class': 'insertion'\n    },\n    delete: {\n      'data-attr': 'delete'\n    },\n    equal: {\n      'data-attr': 'equal'\n    }\n  }\n};\n```\n\n`editCost` is specific to `processingDiff` and controls the tolerence for hunk separation.  `attrs` can contain any/all/none of the following: `insert`, `delete`, and `equal` where the properties in those objects represent attributes that get added to the tags.\n\nAnother option is to skip angular processing the diff, it's useful when you want to show a diff of a code pre-compiled by angular. The attribute you need to add is called: `skipAngularCompilingOnDiff`. If set to `true`, would skip compiling, otherwise it would compile the diff.\n\nAdd some style\n\n```css\n.match{\n  color: gray;\n}\n\n.ins{\n  color: black;\n  background: #bbffbb;\n}\n\n.del{\n  color: black;\n  background: #ffbbbb;\n}\n```\n\nDevelopment\n-----\n\nDevelopment work requires npm from [Node.js](https://nodejs.org/)\n\nBegin with:\n\n`npm install`\n\nThen you can use:\n\n`npm start` To host the directory so you can see the demo\n\n`npm test` To run the Jasmine tests once\n\n`npm test-watch` To run the Jasmine tests with change detection\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famweiss%2Fangular-diff-match-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famweiss%2Fangular-diff-match-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famweiss%2Fangular-diff-match-patch/lists"}