github-api 3.0.0

A higher-level wrapper around the Github API.

Homepage: https://github.com/github-tools/github#readme

Platform: npm

Language: JavaScript

License: BSD-3-Clause-Clear

Keywords: github, api

Repository: git://github.com/github-tools/github.git

View on registry: https://www.npmjs.com/package/github-api

Direct download link: https://registry.npmjs.org/github-api/-/github-api-3.0.0.tgz

Install: npm install [email protected]


Github.js

Downloads per month Latest version Gitter Travis Codecov

Github.js provides a minimal higher-level wrapper around Github's API.

Usage

/*
   Data can be retrieved from the API either using callbacks (as in versions < 1.0)
   or using a new promise-based API. The promise-based API returns the raw Axios
   request promise.
 */
import GitHub from 'github-api';

// unauthenticated client
const gh = new GitHub();
let gist = gh.getGist(); // not a gist yet
gist.create({
   public: true,
   description: 'My first gist',
   files: {
      "file1.txt": {
         content: "Aren't gists great!"
      }
   }
}).then(function({data}) {
   // Promises!
   let createdGist = data;
   return gist.read();
}).then(function({data}) {
   let retrievedGist = data;
   // do interesting things
});
var GitHub = require('github-api');

// basic auth
var gh = new GitHub({
   username: 'FOO',
   password: 'NotFoo'
   /* also acceptable:
      token: 'MY_OAUTH_TOKEN'
    */
});

var me = gh.getUser(); // no user specified defaults to the user for whom credentials were provided
me.listNotifications(function(err, notifications) {
   // do some stuff
});

var clayreimann = gh.getUser('clayreimann');
clayreimann.listStarredRepos(function(err, repos) {
   // look at all the starred repos!
});

API Documentation

API documentation is hosted on github pages, and is generated from JSDoc; any contributions should include updated JSDoc.

Installation

Github.js is available from npm or unpkg.

npm install github-api
<!-- just github-api source (5.3kb) -->
<script src="https://unpkg.com/github-api/dist/GitHub.min.js"></script>

<!-- standalone (20.3kb) -->
<script src="https://unpkg.com/github-api/dist/GitHub.bundle.min.js"></script>

Compatibility

Github.js is tested on Node.js:

  • 6.x

Note: Github.js uses Promise, hence it will not work in Node.js < 4 without polyfill.


Dependencies Requirements Latest Stable Latest Release Licenses
axios ^0.15.2 0.15.3 0.15.3 MIT
debug ^2.2.0 2.6.3 2.6.3 MIT
js-base64 ^2.1.9 2.1.9 2.1.9 BSD-3-Clause
utf8 ^2.1.1 2.1.2 2.1.2 MIT
Explore the resolved dependency tree for github-api 3.0.0
Development Dependencies Requirements Latest Stable Latest Release Licenses
babel-core ^6.7.7 6.24.0 7.0.0-alpha.2 MIT
babelify ^7.3.0 7.3.0 7.3.0 MIT
babel-plugin-add-module-exports ^0.2.1 0.2.1 0.2.1 MIT
babel-plugin-istanbul 3.0.0 4.1.1 4.1.1 BSD-3-Clause
babel-plugin-transform-es2015-modules-umd ^6.5.0 6.24.0 7.0.0-alpha.1 MIT
babel-preset-es2015 ^6.5.0 6.24.0 7.0.0-alpha.1 MIT
babel-register ^6.7.2 6.24.0 7.0.0-alpha.2 MIT
browserify ^13.0.0 14.1.0 14.1.0 MIT
codecov ^1.0.1 2.1.0 2.1.0 MIT
del ^2.2.0 2.2.2 2.2.2 MIT
eslint-config-google ^0.7.0 0.7.1 0.7.1 Apache-2.0
eslint-plugin-mocha ^4.7.0 4.9.0 4.9.0 MIT
gulp ^3.9.0 3.9.1 3.9.1 MIT
gulp-babel ^6.1.2 6.1.2 6.1.2 MIT
gulp-eslint ^3.0.1 3.0.1 3.0.1 MIT
gulp-jscs ^4.0.0 4.0.0 4.0.0 MIT
gulp-jscs-stylish ^1.3.0 1.4.0 1.4.0 MIT
gulp-rename ^1.2.2 1.2.2 1.2.2 MIT
gulp-sourcemaps ^2.2.0 2.4.1 2.4.1 ISC
gulp-uglify ^2.0.0 2.1.2 2.1.2 MIT
jsdoc ^3.4.0 3.4.3 3.4.3 Apache-2.0
minami ^1.1.1 1.1.1 1.1.1 Apache-2.0
mocha ^3.1.2 3.2.0 3.2.0 MIT
must ^0.13.1 0.13.2 0.13.2 Other
nock ^9.0.2 9.0.9 9.0.9 MIT
nyc 9.0.1 10.1.2 10.2.0-candidate.0 ISC
vinyl-buffer ^1.0.0 1.0.0 1.0.0 MIT
vinyl-source-stream ^1.1.0 1.1.0 1.1.0 MIT
Explore the resolved development dependency tree for github-api 3.0.0

Releases

  • 3.0.0 - January 04, 2017 14:59
  • 2.4.0 - September 16, 2016 15:24
  • 2.3.0 - June 17, 2016 14:45
  • 2.2.0 - May 27, 2016 19:48
  • 2.1.0 - May 25, 2016 22:25
  • 2.0.0 - May 19, 2016 18:51
  • 1.3.0 - May 17, 2016 16:17
  • 1.2.1 - May 12, 2016 12:36
  • 1.2.0 - May 11, 2016 21:47
  • 1.1.0 - May 03, 2016 14:16
See all 19 releases

Project Statistics

SourceRank 19
Dependencies 4
Dependent projects 76
Dependent repositories 1.03K
Total releases 19
Latest release
First release
Stars 2.23K
Forks 519
Watchers 87
Contributors 91
Repo Size: 2.26 MB

Top Contributors See all

Aurelio De Rosa Clay Reimann Nick Ændrew Rininsland Matt Pass Sergey Klimov coderaiser iamdanfox Benjamin Longearet Matt Smith Cristian Talau Raphaël Pinson mironal Kevin Decker =^._.^= Daniel X Moore Ryunosuke Sato Jessica Lord Tristen Nemo

Something wrong with this page? Make a suggestion

Export .ABOUT file for this library

Last synced: 2017-03-12 11:56:52 UTC

Login to resync this project