Skip to content

aaronedev/github_extension_repo_size

Repository files navigation

GitHub Repo Size Extension

A simple Firefox/Chrome extension that displays the size of the current GitHub repository in various units (Bytes, KB, MB, GB), fetched via the GitHub API.

Features

  • Displays repository size in raw bytes, kilobytes, megabytes, and gigabytes.
  • Provides a "best fit" unit for easy readability.
  • Supports private repositories via optional Personal Access Token (PAT) authentication.
  • Securely stores PAT using browser's storage.sync API.
  • User-friendly settings panel to manage the PAT.

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd repo_size
  2. Load as a Temporary Add-on (Firefox):

    • Open Firefox and navigate to about:debugging.
    • Click on "This Firefox" in the sidebar.
    • Click the "Load Temporary Add-on..." button.
    • Navigate to the cloned repo_size directory and select the manifest.json file.
  3. Load as an Unpacked Extension (Chrome/Chromium):

    • Open Chrome/Chromium and navigate to chrome://extensions.
    • Enable "Developer mode" in the top-right corner.
    • Click the "Load unpacked" button.
    • Navigate to the cloned repo_size directory and select the folder.

Usage

  1. Navigate to any GitHub repository page (e.g., https://github.com/torvalds/linux).
  2. Click the extension icon (a Git logo) in your browser's toolbar.
  3. The popup will display the repository size.

For Private Repositories / Increased Rate Limits

  1. Click the "Settings" link within the extension popup.
  2. Enter your GitHub Personal Access Token (PAT) in the input field.
    • Ensure your PAT has at least the repo scope (for private repositories) or public_repo scope (for public repos to increase rate limits).
  3. Click "Save Token".
  4. The extension will now use this token for authenticated API requests.

Development

Linting and Formatting

To check for linting errors:

npm run lint

To automatically format the code:

npm run format

Testing

To run the unit tests:

npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published