Skip to content

GitHubRepoData

Interface for GitHub API response data.

Definition

tsx
interface GitHubRepoData {
  name: string
  description: string | null
  stargazers_count: number
  forks_count: number
  language: string | null
  topics: string[]
  html_url: string
  homepage: string | null
  created_at: string
  updated_at: string
  fork?: boolean
  archived?: boolean
}

Properties

PropertyTypeDescription
namestringRepository name
descriptionstring | nullRepository description
stargazers_countnumberStar count
forks_countnumberFork count
languagestring | nullPrimary language
topicsstring[]Repository topics
html_urlstringGitHub URL
homepagestring | nullHomepage URL
created_atstringCreation timestamp
updated_atstringLast update timestamp
forkboolean | undefinedWhether the repository is a fork (only from fetchGitHubRepos)
archivedboolean | undefinedWhether the repository is archived (only from fetchGitHubRepos)

Usage

tsx
import { fetchGitHubRepo } from '@manningworks/projex'
import type { GitHubRepoData } from '@manningworks/projex'

const data: GitHubRepoData | null = await fetchGitHubRepo('facebook/react')

if (data) {
  console.log(data.stargazers_count)
  console.log(data.language)
}

Export

tsx
import type { GitHubRepoData } from '@manningworks/projex'