Skip to content

Commit cb10844

Browse files
committed
Updated README.md
1 parent 2461c35 commit cb10844

File tree

1 file changed

+84
-5
lines changed

1 file changed

+84
-5
lines changed

README.md

Lines changed: 84 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Github.js
2-
=============
1+
# Github.js
32

4-
Ever wanted to store a file on Github right from the browser? Here you are.
3+
Github.js provides a minimal higher-level wrapper around git's [plumbing commands](http://git-scm.com/book/en/Git-Internals-Plumbing-and-Porcelain), exposing an API for manipulating GitHub repositories on the file level. It is being developed in the context of Prose, a content editor for GitHub.
54

5+
## Usage
66

77
Create a Github instance.
88

@@ -23,7 +23,8 @@ var github = new Github({
2323
});
2424
```
2525

26-
Expose API for a given repository.
26+
## Repository API
27+
2728

2829
```js
2930
var repo = github.getRepo(reponame);
@@ -75,4 +76,82 @@ Listing all files of a repository is easy too.
7576
repo.list('master', 'path/to/file', function(err, data) {
7677

7778
});
78-
```
79+
```
80+
81+
## User API
82+
83+
84+
```js
85+
var user = github.getUser();
86+
```
87+
88+
List all repositories of the authenticated user.
89+
90+
```js
91+
user.repos(username, function(err, orgs) {
92+
93+
});
94+
```
95+
96+
List organizations the autenticated user belongs to.
97+
98+
```js
99+
user.orgs(function(err, orgs) {
100+
101+
});
102+
```
103+
104+
Show user information for a particular username. Also works for organizations.
105+
106+
```js
107+
user.show(username, function(err, user) {
108+
109+
});
110+
```
111+
112+
List public repositories for a particular user.
113+
114+
```js
115+
user.userRepos(username, function(err, repos) {
116+
117+
});
118+
```
119+
120+
List repositories for a particular organization. Includes private repositories if you are authorized.
121+
122+
```js
123+
user.orgRepos(orgname, function(err, repos) {
124+
125+
});
126+
```
127+
128+
## Tests
129+
130+
Github.js is automatically™ tested by the users of [Prose](http://prose.io). Because of that, we decided to save some time by not maintaining a test suite. Yes, you heard right. :)
131+
132+
133+
## Change Log
134+
135+
### O.6.X
136+
137+
Adds support for organizations and fixes an encoding issue.
138+
139+
### O.5.X
140+
141+
Smart caching of latest commit sha.
142+
143+
### 0.4.X
144+
145+
Added support for [OAuth](http://developer.github.com/v3/oauth/).
146+
147+
### 0.3.X
148+
149+
Support for Moving and removing files.
150+
151+
### 0.2.X
152+
153+
Consider commit messages.
154+
155+
### 0.1.X
156+
157+
Initial version.

0 commit comments

Comments
 (0)