You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>A collection of non-blocking Node.js libgit2 bindings, raw api, convenience api, unit tests, documentation and accomodations to make contributing easier.</p>
40
40
41
-
<h2>dependencies</h2>
41
+
<h2>require</h2>
42
42
<p>
43
43
<ul>
44
44
<li><ahref="http://nodejs.org/" target="_blank">Node.js 0.4.2 or latest</a></li>
45
+
<li><ahref="http://npmjs.org/" target="_blank">NPM</a><em>( if you want the premiere install experience )</em></li>
45
46
<li><ahref="http://git-scm.com/" target="_blank">Git</a><em>( if you want to unit test )</em></li>
46
47
</ul>
47
48
</p>
@@ -52,8 +53,7 @@ <h2>install</h2>
52
53
</p>
53
54
54
55
<h2>use</h2>
55
-
<p>
56
-
<em>emulate `git log`</em>
56
+
<p><em>emulate `git log`</em></p>
57
57
<pre><code>
58
58
// Load in the module
59
59
var git = require( 'nodegit' );
@@ -78,7 +78,27 @@ <h2>use</h2>
78
78
});
79
79
</code>
80
80
</pre>
81
-
</p>
81
+
82
+
<p><em>view commit tree and blob information</em></p>
83
+
<pre><code>
84
+
// Load in the module
85
+
var git = require( 'nodegit' );
86
+
// Open a repository for reading
87
+
git.repo( '.git', function( err, repo ) {
88
+
// Success is always 0, failure is always an error string
89
+
if( err ) { throw err; }
90
+
// Use the master branch
91
+
repo.branch( 'master', function( err, branch ) {
92
+
if( err ) { throw err; }
93
+
// Iterate over the revision history
94
+
branch.tree().each( function( i, entry ) {
95
+
console.log( entry.name );
96
+
console.log( entry.content );
97
+
});
98
+
});
99
+
});
100
+
</code>
101
+
</pre>
82
102
83
103
84
104
<h2>download</h2>
@@ -106,6 +126,8 @@ <h2>download</h2>
106
126
107
127
</div>
108
128
129
+
<atarget="_blank" href="http://bostonbuilt.org"><imgclass="boston" src="img/boston.gif" alt="Built in Boston USA"></a>
0 commit comments