Files
2025-05-30 19:59:02 +00:00

19 lines
451 B
JavaScript

import _ from "lodash-es"
async function getPopularLanguages() {
const url =
"https://api.github.com/search/repositories?q=stars:%3E1&sort=stars"
const resp = await fetch(url)
const repos = await resp.json()
return _(repos.items)
.map(r => r.language)
.filter(l => l != null)
.countBy()
.toPairs()
.orderBy(([lang, useCount]) => useCount, "desc")
.map(([lang]) => lang)
.value()
}
await getPopularLanguages()