Github.js provides a minimal higher-level wrapper around Github's API.
/*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 Axiosrequest promise.*/;// unauthenticated clientconst gh = ;let gist = gh; // not a gist yetgist;
var GitHub = ;// basic authvar gh =username: 'FOO'password: 'NotFoo'/* also acceptable:token: 'MY_OAUTH_TOKEN'*/;var me = gh; // no user specified defaults to the user for whom credentials were providedme;var clayreimann = gh;clayreimann;
API documentation is hosted on github pages, and is generated from JSDoc; any contributions should include updated JSDoc.
Github.js is available from
npm or unpkg.
npm install github-api
<!-- just github-api source (5.3kb) --><!-- standalone (20.3kb) -->
Github.js is tested on Node.js:
Github.js uses Promise, hence it will not work in Node.js < 4 without polyfill.