{"id":22795819,"url":"https://github.com/brkn/git-blame-line","last_synced_at":"2025-04-19T12:46:31.382Z","repository":{"id":57251081,"uuid":"313090067","full_name":"brkn/git-blame-line","owner":"brkn","description":"`git blame`  a single line and get output in JSON. Written in TypeScript.","archived":false,"fork":false,"pushed_at":"2020-11-17T15:02:27.000Z","size":368,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T18:13:36.387Z","etag":null,"topics":["blame","cli","git","json","typescript"],"latest_commit_sha":null,"homepage":"","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/brkn.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":"2020-11-15T17:53:29.000Z","updated_at":"2023-10-16T06:26:35.000Z","dependencies_parsed_at":"2022-08-24T16:51:57.892Z","dependency_job_id":null,"html_url":"https://github.com/brkn/git-blame-line","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/brkn%2Fgit-blame-line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkn%2Fgit-blame-line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkn%2Fgit-blame-line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkn%2Fgit-blame-line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brkn","download_url":"https://codeload.github.com/brkn/git-blame-line/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766683,"owners_count":21158302,"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":["blame","cli","git","json","typescript"],"created_at":"2024-12-12T05:08:47.624Z","updated_at":"2025-04-19T12:46:31.352Z","avatar_url":"https://github.com/brkn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/git-blame-line?style=for-the-badge)](https://www.npmjs.com/package/git-blame-line) [![NPM downloads](https://img.shields.io/npm/dw/git-blame-line?style=for-the-badge)](https://www.npmjs.com/package/git-blame-line)\n\n# Git-blame-line\n\nExecutes `git blame` asynchronously for a given `\u003cfilepath\u003e:\u003clinenumber\u003e` string, and returns the information in JSON format.\n\n```sh\nnpm install --global git-blame-line\n```\n\n## CLI\n\nYou don't need to remember git syntax to get blame info for single line now. Instead of writing this:\n\n```sh\ngit blame -L 19,+1 --line-porcelain src/index.ts\n```\n\nYou can execute this from command line:\n\n```sh\nblame-line src/index.ts:19\n```\n\nAnd the output would be in the shape as:\n```\n{\n  \"author\": \"Berkan Unal\",\n  \"authorMail\": \"Berkanunal@gmail.com\",\n  \"authorTime\": \"2020-11-15T17:35:01.000Z\",\n  \"authorTz\": \"+0300\",\n  \"committer\": \"Berkan Unal\",\n  \"committerMail\": \"Berkanunal@gmail.com\",\n  \"committerTime\": \"2020-11-15T17:35:01.000Z\",\n  \"committerTz\": \"+0300\",\n  \"summary\": \"Remove babel webpack, add eslint, lint project\",\n  \"previous\": \"816634e51cf31c2d7bd18b7a8b082aff539e1bcd src/index.ts\",\n  \"filename\": \"src/index.ts\",\n  \"sourceCode\": \"export async function blameLine(filepathWithLine: string): Promise\u003cBlameInfo\u003e {\"\n}\n```\n\n## Installing for using inside a node project\n\n```sh\nyarn add git-blame-line\n```\nor \n```sh\nnpm install git-blame-line\n```\n\nThen import in the project and use it easily like this \u003csup\u003e1\u003c/sup\u003e:\n\n```js\nconst { blameLine } = require(\"git-blame-line\");\n\nasync function example() {\n  const info = await blameLine(\"path/to/file:123\");\n  console.log(info);\n}\n\nexample();\n```\n\n\u003csup\u003e1\u003c/sup\u003e You don't have to use requirejs syntax\n\n## License\n\nMPL-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrkn%2Fgit-blame-line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrkn%2Fgit-blame-line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrkn%2Fgit-blame-line/lists"}