Github Adapter
A small javascript adapter library to help other javascript projects to use Github API.
Installation
Install using npm
$ npm install github-adapter --save
Install using yarn
$ yarn add github-adapter
Usage
import GithubAdapter from 'github-adapter';
var GithubAdapter = require('github-adapter');
Initialize the adapter using the github token
var adapter = new GithubAdapter(token);
Following API calls are supported
API
getRateLimit
Gets the current rate limit status set by the
rate-limit-rules using this method
Parameters
getCurrentUser
Gets the current user for the token passed
Parameters
postIssue
Posts the issue
Parameters
getIssue
Gets a issue
Parameters
getPR
Gets a pull request
Parameters
getPRDiff
Gets the diff version of a pull request
Parameters
getPRFiles
Gets the list of files created/updated in the pull request.
This also contains the patch which can be used to know the changes made to the file.
Parameters
getRawContent
Gets the raw content for a given full URL
Parameters
Creates a comment on a given line of a given PR
Parameters
requestCallback
This callback is displayed as part of the Requester class.
Parameters
error
object The error objectdata
object Data received from api call