fetchTopLanguages
The fetcher behind the top languages card.
Fetch top languages for a given username.
fetchTopLanguages(options, config: CardConfig): Promise<TopLangData>| Option | Type | Required | What it is |
|---|---|---|---|
username | string | undefined | yes | — |
exclude_repo | string[] | undefined | no | — |
size_weight | number | undefined | no | — |
count_weight | number | undefined | no | — |
ownerAffiliations | string[] | undefined | no | — |
Returns Promise<TopLangData> — Top languages data.
Weighting
Section titled “Weighting”size_weight and count_weight decide what “most” means, and they are multiplied:
size_weight=1&count_weight=0 ranks by bytes of code, 0 and 1 ranks by how many repositories
use the language, and 1 and 1 by both. The default is bytes.
What comes back
Section titled “What comes back”A TopLangData — every language keyed by name, each with its size, its count and the colour
GitHub gives it. Nothing is truncated: langs_count is the card’s business, not the fetcher’s.