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.
- 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.syncAPI. - User-friendly settings panel to manage the PAT.
-
Clone the repository:
git clone <repository-url> cd repo_size
-
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_sizedirectory and select themanifest.jsonfile.
- Open Firefox and navigate to
-
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_sizedirectory and select the folder.
- Open Chrome/Chromium and navigate to
- Navigate to any GitHub repository page (e.g.,
https://github.com/torvalds/linux). - Click the extension icon (a Git logo) in your browser's toolbar.
- The popup will display the repository size.
- Click the "Settings" link within the extension popup.
- Enter your GitHub Personal Access Token (PAT) in the input field.
- Ensure your PAT has at least the
reposcope (for private repositories) orpublic_reposcope (for public repos to increase rate limits).
- Ensure your PAT has at least the
- Click "Save Token".
- The extension will now use this token for authenticated API requests.
To check for linting errors:
npm run lintTo automatically format the code:
npm run formatTo run the unit tests:
npm test