{"id":18927342,"url":"https://github.com/therebelrobot/diff-compare","last_synced_at":"2025-04-15T13:33:50.899Z","repository":{"id":34718098,"uuid":"38695246","full_name":"therebelrobot/diff-compare","owner":"therebelrobot","description":"A line-by-line diffing tool that returns adjusted comparison texts","archived":false,"fork":false,"pushed_at":"2016-02-25T12:04:31.000Z","size":200,"stargazers_count":7,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T22:09:17.211Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/therebelrobot.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}},"created_at":"2015-07-07T15:03:42.000Z","updated_at":"2023-09-08T16:59:23.000Z","dependencies_parsed_at":"2022-08-25T02:21:10.719Z","dependency_job_id":null,"html_url":"https://github.com/therebelrobot/diff-compare","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therebelrobot%2Fdiff-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therebelrobot%2Fdiff-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therebelrobot%2Fdiff-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/therebelrobot%2Fdiff-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/therebelrobot","download_url":"https://codeload.github.com/therebelrobot/diff-compare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504685,"owners_count":21115193,"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-11-08T11:18:50.800Z","updated_at":"2025-04-15T13:33:50.679Z","avatar_url":"https://github.com/therebelrobot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diff-compare\n\n\n[![NPM](https://nodei.co/npm/diff-compare.png?downloads=true)](https://nodei.co/npm/diff-compare/)\n[![NPM](https://nodei.co/npm-dl/diff-compare.png?months=3\u0026height=2)](https://nodei.co/npm/diff-compare/)\n\n[![Join the chat at https://gitter.im/therebelrobot/diff-compare](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/therebelrobot/diff-compare?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n[![Dependency Status](https://david-dm.org/therebelrobot/diff-compare.svg)](https://david-dm.org/therebelrobot/diff-compare)\n[![semver](https://img.shields.io/badge/semver-1.0.2-blue.svg?style=flat)](http://semver.org/)\n[![changelog](https://img.shields.io/badge/changelog-KACL-orange.svg?style=flat)](http://keepachangelog.com/)\n\nA javascript library for diffing text and generating corrected and annotated text.  This is a fork and derivative of\n[ForbesLindesay/jsdifflib](https://github.com/ForbesLindesay/jsdifflib), which is in turn a fork of [cemerick/jsdifflib](https://github.com/cemerick/jsdifflib)\n\nThe main difference between this lib and [ForbesLindesay/jsdifflib](https://github.com/ForbesLindesay/jsdifflib) is `jsdifflib` returns an HTML node for direct embedding (a table no less), and this module just returns the adjusted text in a JS object. I was implementing a separate view system, so I just needed the data alone.\n\n## Installation\n\n    npm install diff-compare\n\n## Overview\n\ndiff-compare is a Javascript library that provides:\n\n1. a partial reimplementation of Python’s difflib module (specifically, the SequenceMatcher class)\n2. rather than a view generator, as the previous modules have made, this provides a corrected list of items, language agnostic\n\n## Example\n\n```js\nvar diff = require('diff-compare');\n\nvar adjustedText = diff.build({\n  baseText: baseText,\n  newText: newText\n})\n\n// {\n//   base: [{\n//       originalLine: 1,\n//       value: 'abc',\n//       type: 'delete'\n//     }, {\n//       originalLine: 2,\n//       value: 'def',\n//       type: 'equal'\n//     }],\n//   compare: [{\n//       originalLine: null,\n//       value: '',\n//       type: 'delete'\n//     }, {\n//       originalLine: 1,\n//       value: 'def',\n//       type: 'equal'\n//     }]\n// }\n\n```\n\n## Changelog\n### [Unreleased](https://github.com/therebelrobot/diff-compare/compare/release/v1.0.2...master)\n*branch: [`master`](https://github.com/therebelrobot/diff-compare)*\n\n| Type | Link | Description |\n| ---- | ---- | ----------- |\n\n### [v1.0.2](https://github.com/therebelrobot/diff-compare/compare/release/v1.0.1...release/v1.0.2) | 2015-07-20\n*branch: [`release/v1.0.2`](https://github.com/therebelrobot/diff-compare/tree/release/v1.0.2)*\n\n| Type | Link | Description |\n| ---- | ---- | ----------- |\n| Added | [`e66bd85`](https://github.com/therebelrobot/diff-compare/commit/e66bd852fd5be81e7764634f8cec218c724cf05b) | Added badges and changelog to Readme |\n\n### [v1.0.1](https://github.com/therebelrobot/diff-compare/compare/release/v1.0.0...release/v1.0.1) | 2015-07-20\n*branch: [`release/v1.0.1`](https://github.com/therebelrobot/diff-compare/tree/release/v1.0.1)*\n\n| Type | Link | Description |\n| ---- | ---- | ----------- |\n| Added | [`6aa50a7`](https://github.com/therebelrobot/diff-compare/commit/6aa50a72372b62ca1e426f2446073585290b8e9f) | Added badges |\n| Changed | [`6aa50a7`](https://github.com/therebelrobot/diff-compare/commit/6aa50a72372b62ca1e426f2446073585290b8e9f) | Refactored build opts keys |\n| Fixed | [`a371e21`](https://github.com/therebelrobot/diff-compare/commit/a371e214bc3cf65b541fb0ece0344e631323b030) | Code Climate CLI issue |\n\n### [v1.0.0](https://github.com/therebelrobot/diff-compare/commit/46d3bd2f9f21770970094a8c35bea8e62cf4356d) | 2015-07-14\n*branch: [`release/v1.0.0`](https://github.com/therebelrobot/diff-compare/tree/release/v1.0.0)*\n\n| Type | Link | Description |\n| ---- | ---- | ----------- |\n| Added | | Initial Release - Converted HTML output to pure JS output |\n\n\n## License\n\n  Dual License: BSD + ISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherebelrobot%2Fdiff-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftherebelrobot%2Fdiff-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftherebelrobot%2Fdiff-compare/lists"}