Fubuki
Github GraphQL API Client
This package refers the following:
Github GraphQL API
-Here
Generate Github Acess TokenInstall
npm install --save fubuki
Usage
const { GithubClient } = require('fubuki')
// import { GithubClient } from 'fubuki'
const fubuki = new GithubClient(github_accessToken)
Get a user
const data = await fubuki.getUser('alensaito1')
console.log(data) /* {
name: 'Alen Yohannan'
login: 'alensaito1'
pullRequests: {
totalCount: 1400
}...*/
Get a Repository
const data = await fubuki.getRepository({
owner: 'alensaito1',
repository: 'fubuki'
})
console.log(data) /* {
description: 'Github GQL API Client'
forks: {
totalCount: 0
}...*/
Get the contributions calender of a user
const data = await fubuki.getContributionsCalendar('alensaito1')
console.log(data) /*{
weeks: {
[contributionDays: [{
color: '#ebedf0'
contributionCount: 9
contributionLevel:'FIRST_QUARTILE'
date: '2021-07-13'
}...]
}...]
}*/