github-language-usage
Search for all the languages used by a given github user and returns the average values in percentages. Package is written in Typescript.
How it works
- This package uses GitHub GraphQL API to fetch the neccessary data.
- It will search for all the languages used by a given github user and then calculate how the ratio is in percentages.
- Depending on the token read permissions it will search in the public and private repositories of the given user.
Installation
npm:
npm i github-language-usage
or yarn:
yarn add github-language-usage
Usage
You'll need an Github OAuth token with the repo scope.
In Javascript:
{ const result = await console //=> [ { name: 'HTML', color: '#e34c26', percentage: 70}, {...} ]}
API
githubLanguageUsage(token, user, [repos])
token (string): Your Github OAuth token
user (string): The Github user name
repos (number): This is optional. It will search within the first _n_ elements from the
repositories. The default is 100
Real world example
I use it to showcase my github language usage on my personal website: