gh2
v0.0.1 github api
gh
Little github client.
Installation
$ npm install gh2
Example
var Github = require('gh2');
var gh = new Github({
token: 'github-auth-token'
});
gh.lookup('visionmedia/co', '1.x', function(err, release){
});
API
Client(opts:Object)
Fetch releases with opts
:
token
optional github tokenuser
optional github userpass
optional github passua
user-agent string [gh]
Client#stream(repo:String, ref:String, path:String)
Return a stream for repo
's path
at ref
.
gh.stream('component/tip', '1.0.0', 'component.json');
Client#get(path:String, fn:Function)
GET the given path
.
Client#releases(repo:String, fn:Function)
Respond with releases for repo
.
gh.releases('component/tip', fn);
Client#contents(repo:String, ref:String, path:String, fn:Function)
Get contents of path
at `ref.
gh.contents('component/tip' '1.0.0', 'component.json', fn);
Client#lookup(repo:String, version:String, fn:Function)
Lookup semver release of repo
at the given version
.
gh.lookup('component/tip', '1.x', fn);
Running tests
$ TOKEN=<token> USER=<user> PASS=<pass> make test
License
MIT