https://github.com/purecloudlabs/github-api-promise
A node module for interfacing with the Github API using promises
https://github.com/purecloudlabs/github-api-promise
Last synced: over 1 year ago
JSON representation
A node module for interfacing with the Github API using promises
- Host: GitHub
- URL: https://github.com/purecloudlabs/github-api-promise
- Owner: purecloudlabs
- License: mit
- Created: 2016-01-13T18:14:28.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-02-13T23:04:41.000Z (over 2 years ago)
- Last Synced: 2024-04-14T23:58:08.466Z (over 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 1.2 MB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
npm install github-api-promise
```
# Resources
- [Documentation](https://purecloudlabs.github.io/github-api-promise/)
- [](https://www.npmjs.com/package/github-api-promise)
# Usage
TLDR;
1. import _github-api-promise_
2. Set settings
3. Make API calls
Basic example code:
```JavaScript
import api from "github-api-promise";
// Set settings
api.config.owner = 'OwnersGithubUsername';
api.config.repo = 'RepoName';
api.config.token = 'YourAccessToken';
api.config.debug = true; // Default is false. Logs request information via console.log when true.
// Do stuff
api.repos.releases.getRepositoryReleases()
.then((res) => {
// Do your stuff here. res is the JSON object returned by the API
})
.catch((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](https://help.github.com/articles/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!
- Activity
- [Events](https://developer.github.com/v3/activity/events/)
- Issues
- [Comments](https://developer.github.com/v3/issues/comments/)
- [Events](https://developer.github.com/v3/issues/events/)
- [Issues](https://developer.github.com/v3/issues/)
- Pull Requests
- [Comments](https://developer.github.com/v3/pulls/comments/)
- [Pull Requests](https://developer.github.com/v3/pulls/)
- Repositories
- [Commits](https://developer.github.com/v3/repos/commits/)
- [Contents](https://developer.github.com/v3/repos/contents/)
- [Releases](https://developer.github.com/v3/repos/releases/)
- [Repositories](https://developer.github.com/v3/repos/)
- Teams
- [Teams](https://developer.github.com/v3/teams/)
# Thanks
Special thanks to [jeejkang](https://github.com/jeejkang) for the [Stormtroopocat](https://octodex.github.com/stormtroopocat/) image!
Thanks to [aktau/github-release](https://github.com/aktau/github-release) (a library for GO) for the inspiration for this project.