Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4f8de0e

Browse files
committed
Updated README.md
1 parent 750a7c6 commit 4f8de0e

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var github = new Github({
2727

2828

2929
```js
30-
var repo = github.getRepo(reponame);
30+
var repo = github.getRepo(username, reponame);
3131
```
3232

3333
Retrieve all available branches (aka heads) of a repository.
@@ -70,14 +70,31 @@ repo.remove('master', 'path/to/file', function(err) {
7070
});
7171
```
7272

73-
Listing all files of a repository is easy too.
73+
Exploring files of a repository is easy too by accessing the top level tree object.
7474

7575
```js
76-
repo.list('master', 'path/to/file', function(err, data) {
76+
repo.getTree('master', function(err, tree) {
7777

7878
});
7979
```
8080

81+
If you want to access all blobs and trees recursively, you can add `?recursive=true`.
82+
83+
```js
84+
repo.getTree('master?recursive=true', function(err, tree) {
85+
86+
});
87+
```
88+
89+
Given a filepath, retrieve the reference blob or tree sha.
90+
91+
```js
92+
repo.getSha('master', '/path/to/file', function(err, sha) {
93+
94+
});
95+
```
96+
97+
8198
## User API
8299

83100

@@ -133,7 +150,6 @@ Github.js is automatically™ tested by the users of [Prose](http://prose.io). B
133150

134151
Github.js has the following dependencies:
135152

136-
- jQuery (for ajax)
137153
- Underscore
138154
- Base64 (for basic auth). You can leave this if you are not using basic auth.
139155

0 commit comments

Comments
 (0)