A higher-level wrapper around the Github API.
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
Github.js is available from
npm or (soon) cdnjs.
npm install github-api
Github.js is tested on Node:
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.
/*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 theraw HTTP request promise; this might change in the next version.*/var GitHub = require'github-api';// unauthenticated clientvar gh = ;var gist = ghgetGist; // not a gist yetgistcreatepublic: truedescription: 'My first gist'files:"file1.txt":contents: "Aren't gists great!"then// Promises!var gist = httpResponsedata;gistread// if no error occurred then err == null// gist == httpResponse.data// xhr == httpResponse;;
var GitHub = require'github-api';// basic authvar gh =username: 'FOO'password: 'NotFoo';var me = ghgetUser;megetNotification// do some stuff;var clayreimann = ghgetUser'clayreimann';clayreimanngetStarredReposthenvar repos = httpPromisedata;;
var GitHub = require'github-api';// token authvar gh =token: 'MY_OAUTH_TOKEN';var yahoo = ghgetOrganization'yahoo';yahoogetRepos// look at all the repos!