{"id":29726812,"url":"https://github.com/lmlk-seal/github-repo-stats","last_synced_at":"2026-05-16T18:36:52.655Z","repository":{"id":304733933,"uuid":"1019772257","full_name":"LMLK-seal/Github-Repo-Stats","owner":"LMLK-seal","description":"A simple Node.js script to fetch and display traffic statistics (views and unique visitors) for a specified GitHub repository using the GitHub API.","archived":false,"fork":false,"pushed_at":"2026-03-02T11:59:04.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T15:36:37.236Z","etag":null,"topics":["api","github-api","javascript","nodejs","repository","statistics","stats","traffic"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LMLK-seal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-14T21:08:27.000Z","updated_at":"2026-03-02T11:59:08.000Z","dependencies_parsed_at":"2025-07-15T02:15:30.788Z","dependency_job_id":"c4217f4c-8ad9-44f7-9a8f-99c3aa35de06","html_url":"https://github.com/LMLK-seal/Github-Repo-Stats","commit_stats":null,"previous_names":["lmlk-seal/github-repo-stats"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LMLK-seal/Github-Repo-Stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMLK-seal%2FGithub-Repo-Stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMLK-seal%2FGithub-Repo-Stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMLK-seal%2FGithub-Repo-Stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMLK-seal%2FGithub-Repo-Stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LMLK-seal","download_url":"https://codeload.github.com/LMLK-seal/Github-Repo-Stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMLK-seal%2FGithub-Repo-Stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33114582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","github-api","javascript","nodejs","repository","statistics","stats","traffic"],"created_at":"2025-07-25T00:22:03.097Z","updated_at":"2026-05-16T18:36:52.649Z","avatar_url":"https://github.com/LMLK-seal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Repo Traffic Stats\n\n![Language](https://img.shields.io/badge/language-JavaScript-yellow.svg)\n![License](https://img.shields.io/badge/license-ISC-green.svg)\n\nA simple Node.js script to fetch and display traffic statistics (views and unique visitors) for a specified GitHub repository using the GitHub API.\n\nThis tool provides a quick way to see recent traffic data directly from your terminal, requiring a GitHub Personal Access Token with the necessary permissions.\n\n✨ Features\n\n*   Fetches total views and unique visitors for the last 14 days.\n*   Displays a daily breakdown of views and unique visitors.\n*   Uses environment variables (`.env`) to securely store your GitHub Personal Access Token.\n*   Provides helpful error messages for invalid input or API issues.\n\n📚 Tech Stack\n\n*   **Language:** JavaScript (Node.js)\n*   **Libraries:**\n    *   [Axios](https://axios-http.com/) (Promise-based HTTP client)\n    *   [Dotenv](https://github.com/motdotela/dotenv) (Loads environment variables from a `.env` file)\n\n🚀 Installation\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/LMLK-seal/github-repo-stats.git\n    cd github-repo-stats\n    ```\n\n2.  **Install dependencies:**\n    ```bash\n    npm install\n    ```\n\n3.  **Create a `.env` file:**\n    Create a file named `.env` in the root directory of the project.\n\n4.  **Obtain a GitHub Personal Access Token:**\n    *   Go to your GitHub Settings \u003e Developer settings \u003e Personal access tokens \u003e Tokens (classic).\n    *   Click \"Generate new token\".\n    *   Give your token a descriptive name (e.g., `repo-stats-script`).\n    *   Crucially, select the `repo` scope, specifically ensure `repo:traffic` is checked.\n    *   Click \"Generate token\".\n    *   **Copy the generated token immediately.** You won't be able to see it again.\n\n5.  **Add your token to `.env`:**\n    Open the `.env` file you created in step 3 and add the following line, replacing `Your_key_here` with the token you copied:\n    ```env\n    GITHUB_TOKEN=Your_key_here\n    ```\n\n▶️ Usage\n\nRun the script from your terminal, providing the repository name in the format `owner/repo` as a command-line argument.\n\n```bash\nnode get-stats.js owner/repository\n```\n\n**Example:**\n\n```bash\nnode get-stats.js facebook/react\n```\nThe script will then fetch and print the traffic data for the specified repository.\n\n---\n\n# Views vs Unique Visitors\n\n## Overview\n\nUnderstanding the difference between views and unique visitors is crucial for analyzing your repository's performance and audience engagement.\n\n## Metric Definitions\n\n### Views\n**Views** represent the total number of times your repository page has been loaded. \n\n- **Counting Method**: Each page load is counted as one view\n- **Example**: If one person visits your page 10 times, that counts as **10 views**\n- **What it measures**: Overall activity and interest levels\n\n### Unique Visitors\n**Unique Visitors** represent the number of individual people who have viewed your repository.\n\n- **Counting Method**: Each person is counted only once per day, regardless of how many times they visit\n- **Example**: If the same person visits your page 10 times in one day, they are counted as **1 unique visitor** for that day\n- **What it measures**: The size and reach of your audience\n\n## Why Both Metrics Matter\n\nBoth metrics provide valuable insights into different aspects of your audience's behavior:\n\n| Metric | What It Tells You | Usefulness |\n|--------|------------------|------------|\n| **Views** | Measures overall activity and interest. A high view count indicates your repository is receiving significant attention, even if from a smaller group of engaged users. | **Immediate Impact**: Ideal for assessing the short-term impact of promotions, such as tweets or blog posts. A spike in views indicates your content is being actively shared and consumed. |\n| **Unique Visitors** | Measures the size and reach of your audience. This metric reveals how many different individuals are discovering and engaging with your project. | **Long-term Growth**: Best for understanding sustainable growth patterns. A steadily increasing unique visitor count indicates you're consistently attracting new people, not just repeat visits. |\n\n\n🤝 Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n📝 License\n\nDistributed under the ISC License. See `LICENSE` file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmlk-seal%2Fgithub-repo-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmlk-seal%2Fgithub-repo-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmlk-seal%2Fgithub-repo-stats/lists"}