github-api 2.4.0

A higher-level wrapper around the Github API.

Homepage: https://github.com/michael/github

Platform: npm

Language: JavaScript

License: BSD-3-Clause-Clear

Keywords: github, api

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

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

Install: npm install [email protected]


Github.js

Downloads per month Latest version Gitter Travis

Github.js provides a minimal higher-level wrapper around Github's API. It was concieved in the context of Prose, a content editor for GitHub.

Read the docs

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:

  • 6.x
  • 5.x
  • 4.x
  • 0.12

GitHub Tools

The team behind Github.js has created a whole organization, called GitHub Tools, dedicated to GitHub and its API. In the near future this repository could be moved under the GitHub Tools organization as well. In the meantime, we recommend you to take a look at other projects of the organization.

Samples

/*
   Data can be retrieved from the API either using callbacks (as in versions < 1.0)
   or using a new promise-based API. For now the promise-based API just returns the
   raw HTTP request promise; this might change in the next version.
 */
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 gistJson = data;
   gist.read(function(err, gist, xhr) {
      // if no error occurred then err == null

      // gistJson === httpResponse.data

      // xhr === httpResponse
   });
});
import GitHub from 'github-api';

// basic auth
const gh = new GitHub({
   username: 'FOO',
   password: 'NotFoo'
});

const me = gh.getUser();
me.listNotifications(function(err, notifications) {
   // do some stuff
});

const clayreimann = gh.getUser('clayreimann');
clayreimann.listStarredRepos()
   .then(function({data: reposJson}) {
      // do stuff with reposJson
   });
var GitHub = require('github-api');

// token auth
var gh = new GitHub({
   token: 'MY_OAUTH_TOKEN'
});

var yahoo = gh.getOrganization('yahoo');
yahoo.listRepos(function(err, repos) {
   // look at all the repos!
})

Dependencies Requirements Latest Stable Latest Release Licenses
axios ^0.10.0 0.15.3 0.15.3 MIT
debug ^2.2.0 2.6.0 2.6.0 MIT
es6-promise ^3.0.2 4.0.5 4.0.5 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 2.4.0
Development Dependencies Requirements Latest Stable Latest Release Licenses
babel-core ^6.7.7 6.21.0 6.21.0 MIT
babelify ^7.3.0 7.3.0 7.3.0 MIT
babel-plugin-transform-es2015-modules-umd ^6.5.0 6.18.0 6.18.0 MIT
babel-preset-es2015 ^6.5.0 6.18.0 6.18.0 MIT
babel-register ^6.7.2 6.18.0 6.18.0 MIT
browserify ^13.0.0 13.3.0 13.3.0 MIT
codecov ^1.0.1 1.0.1 1.0.1 MIT
del ^2.2.0 2.2.2 2.2.2 MIT
eslint-config-google ^0.5.0 0.7.1 0.7.1 Apache-2.0
eslint-plugin-mocha ^2.2.0 4.8.0 4.8.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 ^2.0.0 3.0.1 3.0.1 MIT
gulp-jscs ^3.0.2 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 ^1.6.0 2.3.1 2.3.1 ISC
gulp-uglify ^1.5.1 2.0.0 2.0.0 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 ^2.3.4 3.2.0 3.2.0 MIT
must ^0.13.1 0.13.2 0.13.2 Other
nock ^8.0.0 9.0.2 9.0.2 MIT
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 2.4.0

Releases

  • 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
  • 1.0.0 - April 27, 2016 21:29
See all 18 releases

Project Statistics

SourceRank 19
Dependencies 5
Dependent projects 70
Dependent repositories 950
Total releases 18
Latest release
First release
Stars 2.13K
Forks 492
Watchers 86
Contributors 87
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 Cristian Talau Matt Smith mironal Kevin Decker Raphaël Pinson =^._.^= 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: 2016-12-25 10:40:45 UTC