mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
11 lines
335 B
TypeScript
11 lines
335 B
TypeScript
export async function fetchGitHubStars() {
|
|
const res = await fetch('https://api.github.com/repos/pheralb/svgl');
|
|
const response = await res.json();
|
|
const starsFormated =
|
|
response.stargazers_count > 1000
|
|
? `${(response.stargazers_count / 1000).toFixed(1)}K`
|
|
: response.stargazers_count;
|
|
|
|
return starsFormated;
|
|
}
|