github-api-promise
A node module for interfacing with the Github API using promises. The full GitHub API documentation can be found at https://developer.github.com/v3/.
Installation
npm install github-api-promise
Usage
TLDR;
- Require github-api-promise
- Set settings
- Make API calls
Basic example code:
var api = require('github-api-promise');
api.config.owner = 'OwnersGithubUsername';
api.config.repo = 'RepoName';
api.config.token = 'YourAccessToken';
api.config.debug = true;
api.repos.releases.getRepositoryReleases()
.then(function(res) {
})
.catch(function(err) {
console.log('Request failed: ' + err);
});
For help creating an access token, see the GitHub help article Creating an Access Token for Command Line Use. This package only requires either the repo scope for private repos or the public_repo scope for public repos.
API Support
The following APIs are supported. PRs welcome!
Documentation
TODO: JSDoc on github pages. For now, browse the module's source and read the JSDoc comments.
Thanks
Special thanks to jeejkang for the Stormtroopocat image!
Thanks to aktau/github-release (a library for GO) for the inspiration for this project.