Has anyone implemented a git clone or interface library using nodejs?

Gitnode.js

Git Problem Overview


I'm looking for an implementation of git which is accessible from nodejs - does such a beast exist?

Git Solutions


Solution 1 - Git

Looks like there are now several options for using git from node:

  • gift: simple Node.js wrapper for the Git CLI with an API based on Grit (npm / github)
  • node-git: a node.js git implementation modeled on grit (npm / github)
  • nodegit: libgit2 asynchronous native bindings (npm / github)
  • node-git: a thin wrapper around the command-line git command (github)

Solution 2 - Git

Note sure if there's a git library for Node but you can also just execute a shell process directly, example:

var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("git status", puts);

Solution 3 - Git

there is also node-gitteh as libgit2 bindings, but both gitteh and christkv/node-git were not of the quality and completeness I needed

I wrote treeeater a spawn git wrapper, which is callable with plain javascript objects instead of strings, can parse some output (git log → commit objects, git ls-tree → tree object hierachy) and runs async. It is in active use and supports all git commands, atleast for calling them and piping their output chunk or line wise. You can stick to git man-pages to get the documentation to each command.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionblueberryfieldsView Question on Stackoverflow
Solution 1 - GitdribnetView Answer on Stackoverflow
Solution 2 - GitMauvis LedfordView Answer on Stackoverflow
Solution 3 - GitpayloadView Answer on Stackoverflow