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

Skip to content

Commit efbdc06

Browse files
committed
Merge pull request github-tools#42 from guidomb/master
Adds support for repository issues
2 parents 1942ce4 + b40dc9b commit efbdc06

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,13 @@ gist.update(delta, function(err, gist) {
232232

233233
});
234234
```
235+
## Issues API
235236

237+
To read all the issues of a given repository
238+
239+
```js
240+
github.getIssues(owner, repo, function(err, issues) {})
241+
```
236242

237243
## Tests
238244

github.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,26 @@
499499
};
500500
};
501501

502+
// Issues API
503+
// ==========
504+
505+
Github.Issue = function(options) {
506+
var path = "/repos/" + options.owner + "/" + options.repo + "/issues";
507+
508+
this.list = function(options, cb) {
509+
_request("GET", path, options, function(err, res) {
510+
cb(err,res)
511+
});
512+
};
513+
};
514+
502515
// Top Level API
503516
// -------
504517

518+
this.getIssues = function(owner, repo) {
519+
return new Github.Issue({owner: owner, repo: repo});
520+
};
521+
505522
this.getRepo = function(user, repo) {
506523
return new Github.Repository({user: user, name: repo});
507524
};

0 commit comments

Comments
 (0)