Home Reference Source Test Repository

Function

Static Public Summary
public

fetchContributions(username: string): Promise<{calendar: string, contributions: Array<{date: string, count: number}>}, Error>

Fetch contributions of GitHub user

public

fetchStats(username: string, opts: Object): Promise<Stats, Error>

Fetch contributions and streaks of GitHub user

Static Public

public fetchContributions(username: string): Promise<{calendar: string, contributions: Array<{date: string, count: number}>}, Error> source

import {fetchContributions} from 'github-contribution-stats/src/index.js'

Fetch contributions of GitHub user

Params:

NameTypeAttributeDescription
username string

GitHub username

Return:

Promise<{calendar: string, contributions: Array<{date: string, count: number}>}, Error>

Test:

public fetchStats(username: string, opts: Object): Promise<Stats, Error> source

import {fetchStats} from 'github-contribution-stats/src/index.js'

Fetch contributions and streaks of GitHub user

Params:

NameTypeAttributeDescription
username string

GitHub username

opts Object
  • optional

Options

opts.summary boolean
  • optional
  • default: true

Flag of includes summary

Return:

Promise<Stats, Error>

Test: