Socket
Book a DemoInstallSign in
Socket

gh2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh2

little github client

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

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

  • api
  • Client()
  • Client.stream()
  • Client.get()
  • Client.releases()
  • Client.contents()
  • Client.lookup()

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

Keywords

github

FAQs

Package last updated on 05 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts