fetch github trending easily
npm install fetch-github-trending
import fetchGithubTrending, { ProgramLanguage, SpokenLanguage } from 'fetch-github-trending';
const { repositories } = await fetchGithubTrending({
spokenLanguage: SpokenLanguage.English,
programLanguage: ProgramLanguage.TypeScript,
dateRange: 'monthly',
});
console.log(repositories);
output:
[
{
owner: 'freeCodeCamp',
name: 'freeCodeCamp',
description: "freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.",
programLanguage: 'TypeScript',
programLanguageColor: '#3178c6',
starCount: 382086,
starCountInDateRange: 151,
forkCount: 35617,
contributors: ['raisedadead', 'ojeytonwilliams', 'camperbot', 'renovate-bot', 'sahat'],
},
// ...
];
view source for latest options:
interface Options {
spokenLanguage?: SpokenLanguage;
programLanguage?: ProgramLanguage | ProgramLanguage[];
dateRange?: 'daily' | 'weekly' | 'monthly';
}