npm.io
1.0.3 • Published 8 years ago

github-api-client

Licence
MIT
Version
1.0.3
Deps
1
Size
55 kB
Vulns
22
Weekly
0

Github-client

Client for Github API v3.

Installation

npm i github-api-client --save

How to use

import GithubApiClient from 'github-api-client';

const ghClient = new GithubApiClient();

Methods

user( user )

Get user info by user.

ghClient.user('tunadao1')
	.then(res => {
		//your code using response
	});
repos( options )

Get repositories info by username.

const options = {
	username: 'tunadao1',
	page: 1, //Optional
	limit: 50 //Optional
};
    
ghClient.repos( options )
	.then(res => {
		//your code using response
	});
issues( options )

Get issues info by user and repository.

const options = {
	username: 'tunadao1',
	repository: 'github-client'
};

ghClient.issues( options )
	.then(res => {
		//your code using response
	});