A Node.js/TypeScript tool to analyze language statistics across all your GitHub repositories (both public and private) to identify repos with high JavaScript percentages.
This tool helps identify which repositories might have committed node_modules or other JavaScript files that are inflating your GitHub language statistics.
-
Install dependencies:
pnpm install
-
Create a GitHub Personal Access Token:
Create your token here: https://github.com/settings/tokens/new
- Note: Give it a descriptive name (e.g., "GitHub Stats Analyzer")
- Expiration: Choose your preferred expiration (recommended: 90 days)
- Select scopes: Check the following scope:
- ✅
repo- Full control of private repositories- This includes access to public repositories, private repositories, and archived repositories
- ✅
- Click "Generate token" at the bottom of the page
- Important: Copy the token immediately - you won't be able to see it again!
-
Configure environment variables:
cp .env.example .env
Edit the
.envfile and add your token:GITHUB_TOKEN=your_actual_token_here
Run the analyzer:
pnpm startThe tool will:
- Fetch all your repositories (public and private)
- Get language statistics for each repository
- Scan for suspicious files (node_modules, .env, build outputs, etc.)
- Flag repositories with committed node_modules
- Calculate JavaScript percentages
- Display results sorted by JavaScript percentage
- Show repositories with >50% JavaScript (likely suspects)
- Calculate your overall language distribution across all repos
- Generate comprehensive reports in multiple formats
The tool displays:
- Progress updates: Real-time progress as it analyzes each repo
- Repository list: All repos with JavaScript, sorted by JS percentage
- Detailed stats: For each repo, shows all languages and their percentages
- Suspects: Highlights repos with >50% JavaScript
- node_modules warnings: Lists any repos with committed node_modules
- Overall distribution: Your actual language breakdown across all repos
All reports are saved in the reports/ directory with timestamps:
-
JSON Report (
suspicious-repos-YYYY-MM-DD.json)- Structured data grouped by issue type:
{ "node_modules": ["https://github.com/user/repo1", ...], "build_dirs": ["https://github.com/user/repo2", ...], "dotenv_files": ["https://github.com/user/repo3", ...], "extremely_large_repos": ["https://github.com/user/repo4", ...], "single_commit_repos": ["https://github.com/user/repo5", ...], "metadata": { "generated_at": "2025-11-12T...", "total_repos": 260, "repos_analyzed": 260 } } - Note:
.env.examplefiles are NOT flagged - only actual.envand.env.localfiles
- Structured data grouped by issue type:
-
Markdown Report (
report-YYYY-MM-DD.md)- Human-readable summary with:
- Overall statistics
- Language distribution table
- Repositories with node_modules committed
- High JavaScript percentage repositories
- Repositories with build directories
- Repositories with .env files
- Extremely large repositories (>100MB)
- Human-readable summary with:
📊 REPOSITORIES WITH JAVASCRIPT (sorted by JS percentage)
================================================================================
username/suspect-repo (🔒 PRIVATE)
URL: https://github.com/username/suspect-repo
Repo Size: 245,832 KB | Language Stats: 234.56 MB
JavaScript: 98.45%
All languages:
- JavaScript: 98.45% (230.91 MB)
- TypeScript: 1.55% (3.65 MB)
...
⚠️ SUSPECTS (>50% JavaScript):
- username/suspect-repo (98.45% JS)
https://github.com/username/suspect-repo
After identifying the problem repositories:
- Check if
node_moduleswas committed - Remove it with:
git rm -r node_modules git commit -m "Remove committed node_modules" git push - Ensure
.gitignoreincludesnode_modules - Consider using
.gitattributesto exclude certain files from language statistics
ISC