0.0.1 • Published 12 years ago
gh2 v0.0.1
gh
Little github client.
Installation
$ npm install gh2Example
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:
tokenoptional github tokenuseroptional github userpassoptional github passuauser-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 testLicense
MIT
0.0.1
12 years ago