NodeGit
Node bindings to the libgit2 project.
Stable: 0.1.4
Maintained by Tim Branyen @tbranyen, Michael Robinson @codeofinterest, and Nick Kallen @nk, with help from awesome contributors!
API Documentation.
http://www.nodegit.org/nodegit/
Getting started.
NodeGit will work on most systems out-of-the-box without any native dependencies.
npm install nodegit
If you encounter problems while installing, you should try the Building from source instructions below.
Building from source.
Minimum dependencies:
If you wish to help contribute to nodegit it is useful to build locally.
# Fetch this project.git clone git://github.com/tbranyen/nodegit.git# Enter the repository.cd nodegit# Installs the template engine, run the code generation script, and build.npm install
If you encounter errors, you most likely have not configured the dependencies correctly.
Installing dependencies:
Mac OS X
Linux
Using APT in Ubuntu:
sudo apt-get install build-essential
Using Pacman in Arch Linux:
sudo pacman -S base-devel
Windows
You may have to add a build flag to the installation process to successfully install. Try first without, if the build fails, try again with the flag.
Allegedly the order in which you install Visual Studio could trigger this error.
npm install nodegit --msvs_version=2013# Or whatever version you've installed.
API examples.
Cloning a repository and reading a file:
var clone = Repositoryclone;// Clone a given repository into a specific folder.;
Emulating git log:
var open = Repositoryopen;// Open the repository directory.;
Unit tests.
You will need to build locally before running the tests. See above.
npm test