gh2

0.0.1 • Public • Published

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 token
  • user optional github user
  • pass optional github pass
  • ua 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

Readme

Keywords

Package Sidebar

Install

npm i gh2

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • segment-admin
  • tjholowaychuk