mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
Add stars count repository
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user