const formatter = Intl.NumberFormat('en-US', { notation: 'compact', }); export async function countStars( repo = 'kamranahmedse/developer-roadmap' ): Promise { const repoData = await fetch(`https://api.github.com/repos/${repo}`); const json = await repoData.json(); return json.stargazers_count * 1; } export async function getFormattedStars( repo = 'kamranahmedse/developer-roadmap' ): Promise { const stars = await countStars(repo); return formatter.format(stars); }