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
Copy file name to clipboardExpand all lines: README.md
+84-5Lines changed: 84 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
Github.js
2
-
=============
1
+
# Github.js
3
2
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.
5
4
5
+
## Usage
6
6
7
7
Create a Github instance.
8
8
@@ -23,7 +23,8 @@ var github = new Github({
23
23
});
24
24
```
25
25
26
-
Expose API for a given repository.
26
+
## Repository API
27
+
27
28
28
29
```js
29
30
var repo =github.getRepo(reponame);
@@ -75,4 +76,82 @@ Listing all files of a repository is easy too.
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/).
0 commit comments