{"id":29926627,"url":"https://github.com/ecomfe/gitdiff-parser","last_synced_at":"2025-08-02T12:42:52.422Z","repository":{"id":38084250,"uuid":"104313804","full_name":"ecomfe/gitdiff-parser","owner":"ecomfe","description":"A fast and reliable git diff parser.","archived":false,"fork":false,"pushed_at":"2023-04-12T16:54:28.000Z","size":1440,"stargazers_count":64,"open_issues_count":29,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-23T06:49:00.633Z","etag":null,"topics":["diff","git"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/ecomfe.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}},"created_at":"2017-09-21T07:08:53.000Z","updated_at":"2025-02-13T07:53:41.000Z","dependencies_parsed_at":"2024-06-18T14:18:52.924Z","dependency_job_id":null,"html_url":"https://github.com/ecomfe/gitdiff-parser","commit_stats":{"total_commits":45,"total_committers":5,"mean_commits":9.0,"dds":0.6,"last_synced_commit":"ff18592de137c080d77291cf6e26e63c4ebc13da"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ecomfe/gitdiff-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fgitdiff-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fgitdiff-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fgitdiff-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fgitdiff-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/gitdiff-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fgitdiff-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268392180,"owners_count":24243297,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","git"],"created_at":"2025-08-02T12:42:20.572Z","updated_at":"2025-08-02T12:42:52.369Z","avatar_url":"https://github.com/ecomfe.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitdiff-parser\n\nA fast and reliable git diff parser.\n\n## Install\n\n```shell\nnpm install gitdiff-parser\n```\n\n## Usage\n\n```js\nimport gitDiffParser from 'gitdiff-parser';\n\ngitDiffParser.parse(gitDiffText);\n```\n\n`gitDiffText` should be a diff output by `git diff` command.\n\n### API\n\n```ts\nexport interface Change {\n    content: string;\n    type: 'insert' | 'delete' | 'normal';\n    isInsert?: boolean;\n    isDelete?: boolean;\n    isNormal?: boolean;\n    lineNumber?: number;\n    oldLineNumber?: number;\n    newLineNumber?: number;\n}\n\nexport interface Hunk {\n    content: string;\n    oldStart: number;\n    newStart: number;\n    oldLines: number;\n    newLines: number;\n    changes: Change[];\n}\n\nexport interface File {\n    hunks: Hunk[];\n    oldEndingNewLine: boolean;\n    newEndingNewLine: boolean;\n    oldMode: string;\n    newMode: string;\n    similarity?: number;\n    oldRevision: string;\n    newRevision: string;\n    oldPath: string;\n    newPath: string;\n    isBinary?: boolean;\n    type: 'add' | 'delete' | 'modify' ｜ 'rename';\n}\n\nexport default {\n    parse(source: string): File[];\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fgitdiff-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Fgitdiff-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fgitdiff-parser/lists"}