{"id":17482436,"url":"https://github.com/creationix/node-git","last_synced_at":"2025-07-11T16:38:33.499Z","repository":{"id":861438,"uuid":"597157","full_name":"creationix/node-git","owner":"creationix","description":"Node.JS library to read git repositories.","archived":false,"fork":false,"pushed_at":"2015-03-17T15:23:28.000Z","size":166,"stargazers_count":205,"open_issues_count":9,"forks_count":30,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-30T01:55:39.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creationix.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-04-06T14:28:59.000Z","updated_at":"2024-08-23T20:08:46.000Z","dependencies_parsed_at":"2022-08-16T11:15:09.114Z","dependency_job_id":null,"html_url":"https://github.com/creationix/node-git","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/creationix/node-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/node-git/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fnode-git/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259737917,"owners_count":22903870,"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-10-18T23:43:18.862Z","updated_at":"2025-07-11T16:38:33.483Z","avatar_url":"https://github.com/creationix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-git\n\nThis is a thin wrapper around the command-line `git` command for use inside node applications.  It's used primarily by the [wheat][] blogging system to enable a running node.JS server to read files out of a git repository as if they were local files.\n\n## Example usage\n\n```js\nvar sys = require('sys'),\n    Git = require('git');\n\n\n// Test it!\nGit(\"/Users/tim/code/howtonode.org\");\nGit.exists(\"articles/control-flow-part-ii.markdown\", function (err, tags) {\n  if (err) { throw(err); }\n  sys.p(tags);\n});\nGit.getTags(function (err, tags) {\n  if (err) { throw(err); }\n  Object.keys(tags).forEach(function (tag) {\n    Git.readDir(\"articles\", tags[tag], function (err, contents) {\n      if (err) { throw(err); }\n      contents.files.forEach(function (file) {\n        file = Path.join(\"articles\", file);\n        Git.readFile(file, tags[tag], function (err, text) {\n          if (err) { throw(err); }\n          sys.error(\"tag: \" + tag + \" sha1: \" + tags[tag] + \" file: \" + file + \" length: \" + text.length);\n        });\n      });\n    });\n  });\n});\n```\n\nMore example:\n\n```js\nvar sys = require('sys');\n// Git(\"/Users/tim/git/howtonode.org.git\");\nGit(\"/Users/tim/Code/howtonode.org\");\nGit.log(\"articles/what-is-this.markdown\", function (err, data) {\n  if (err) throw err;\n  sys.p(data);\n  process.exit();\n});\n```\n\n[wheat]: http://github.com/creationix/wheat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fnode-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Fnode-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fnode-git/lists"}