gothub

1.0.2 • Public • Published

gothub

A convenience wrapper for got to interact with the GitHub API, very similar to gh-got.

Install

$ npm install --save gothub

Usage

With gh-got, you do this:

var ghGot = require('gh-got');
 
ghGot('users/sindresorhus', {token: 'foo'}, function(err, data){
  console.log(data.login); //=> 'sindresorhus'
});

With gothub, you can do this:

var gothub = require('gothub');
 
var github = new gothub({ token:'foo', endpoint:'https://github-enterprise.example.com/api/v3' });
 
github.get('users/sindresorhus', function(err, data){
  console.log(data.login); //=> 'sindresorhus'
});

gothub moves the token and endpoint options into the constructor.


Much of the work was shamelessly borrowed from Sindre Sorhus - I simply rearranged some things.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    6
  • 1.0.1
    2
  • 1.0.0
    2

Package Sidebar

Install

npm i gothub

Weekly Downloads

10

Version

1.0.2

License

MIT

Last publish

Collaborators

  • flesch