Node.js libgit2 asynchronous native bindings
npm install nodegit-wipnodegit
=======
> Node.js libgit2 bindings
v0.0.78 
Maintained by Tim Branyen @tbranyen and Michael
Robinson @codeofinterest, with help from
awesome
contributors!
API Documentation
------------------------
Documentation may be found here: nodegit documentation.
Contributing
------------
Nodegit aims to eventually provide native asynchronous bindings for as much of
libgit2 as possible, but we can't do it alone!
We welcome pull requests, but please pay attention to the following: whether
your lovely code fixes a bug or adds a new feature, please include unit tests
that either prove the bug is fixed, or that your new feature works as expected.
See running tests
Unit tests are what makes the Node event loop go around.
Building and installing
-----------------------
nodegit you need Node.js, python and cmake. To run unit tests you will need to havegit installed and accessible from your PATH to fetch any vendor/ addons.nodegit.``` bash``
$ npm install nodegit
#### Install nodegit by cloning source from GitHub and running node install: ####
`` bash``
$ git clone git://github.com/tbranyen/nodegit.git
$ cd nodegit
$ node install
\Updating to a new version\
`` bash``
$ git pull
$ node install
#### nodegit has been compiled and tested to work with the setup required to build and run Node.js itself. ####
Instructions on compiling Node.js on a Windows platform can be found here:
https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-(Windows)
API Example Usage
-----------------
#### Convenience API ####
`JavaScript
// Load in the module.
var git = require('nodegit'),
async = require('async');
// Open the repository in the current directory.
git.repo('.git', function(error, repository) {
if (error) {
throw error;
}
// Use the master branch.
repository.branch('master', function(error, branch) {
if (error) {
throw error;
}
// Iterate over the revision history.
branch.history().on('commit', function(error, commit) {
// Print out git log emulation.`
async.series([
function(callback) {
commit.sha(callback);
},
function(callback) {
commit.time(callback);
},
function(callback) {
commit.author(function(error, author) {
author.name(callback);
});
},
function(callback) {
commit.author(function(error, author) {
author.email(callback);
});
},
function(callback) {
commit.message(callback);
}
], function printCommit(error, results) {
console.log('SHA ' + results[0]);
console.log(new Date(results[1] * 1000));
console.log(results[2] + ' <' + results[3] + '>');
console.log(results[4]);
});
});
});
});
Running tests
-------------
__nodegit library code is written adhering to a modified JSHint. Run these checks with make lint in the project root.__
__To run unit tests ensure to update the submodules with git submodule update --init and install the development dependencies nodeunit and rimraf with npm install.__
Then simply run npm test` in the project root.
Release information
-------------------
__Can keep track of current method coverage at: http://bit.ly/tb_methods__
Getting involved
----------------
If you find this project of interest, please document all issues and fork if
you feel you can provide a patch. Testing is of huge importance; by simply
running the unit tests on your system and reporting issues you can contribute!
__Before submitting a pull request, please ensure both that you've added unit
tests to cover your shiny new code, and that all unit tests and lint checks
pass.__
