
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
github-package-analyzer
Advanced tools
A powerful tool to analyze GitHub repositories for package implementation and code quality using the GitHub API and OpenAI's GPT models. Evaluate your dependencies, verify implementations, and get AI-powered suggestions for improvement.
📦 Comprehensive Package Analysis
🤖 AI-Powered Code Analysis
📊 Detailed Reporting
🔄 Repository Tools
npm install github-package-analyzer
You'll need to provide authentication tokens:
const analyzer = new PackageAnalyzer({
githubToken: process.env.GITHUB_TOKEN, // GitHub Personal Access Token
openaiKey: process.env.OPENAI_API_KEY // OpenAI API Key
});
const PackageAnalyzer = require('github-package-analyzer');
const dotenv = require('dotenv');
dotenv.config();
async function main() {
const analyzer = new PackageAnalyzer({
githubToken: process.env.GITHUB_TOKEN,
openaiKey: process.env.OPENAI_API_KEY
});
const result = await analyzer.analyze('owner', 'repo', ['react', 'express']);
console.log(JSON.stringify(result, null, 2));
}
main().catch(console.error);
const PackageAnalyzer = require('github-package-analyzer');
const dotenv = require('dotenv');
dotenv.config();
async function analyzeFullStack() {
// Define custom patterns for various frameworks and libraries
const customPatterns = {
'next': {
filePatterns: ['.js', '.ts', '.jsx', '.tsx'],
codePatterns: [
'from "next"',
'from "next/app"',
'from "next/document"',
'from "next/router"'
]
},
'prisma': {
filePatterns: ['.ts', '.js'],
codePatterns: [
'from "@prisma/client"',
'new PrismaClient',
'prisma.$connect'
]
},
'tailwind': {
filePatterns: ['.css', '.config.js'],
codePatterns: [
'tailwind.config',
'@tailwind base',
'@tailwind components',
'@tailwind utilities'
]
},
'jest': {
filePatterns: ['.test.js', '.spec.js', '.test.ts', '.spec.ts'],
codePatterns: [
'describe(',
'test(',
'it(',
'expect(',
'jest.mock'
]
}
};
// Initialize analyzer with custom patterns
const analyzer = new PackageAnalyzer({
githubToken: process.env.GITHUB_TOKEN,
openaiKey: process.env.OPENAI_API_KEY,
patterns: customPatterns
});
try {
// Analyze multiple aspects of a full-stack application
const result = await analyzer.analyze(
'owner',
'repo',
['react', 'next', 'prisma', 'tailwind', 'jest']
);
// Generate detailed report
console.log('Analysis Summary:');
console.log('----------------');
console.log(`Overall Grade: ${result.summary.grade}`);
console.log(`Average Score: ${result.summary.averageScore}`);
console.log('\nPackage Details:');
result.details.dependencies.forEach(pkg => {
console.log(`\n${pkg.package}:`);
console.log(` Installed: ${pkg.installed}`);
console.log(` Implemented: ${pkg.implementation}`);
if (pkg.scores) {
console.log(` Code Quality: ${pkg.scores.codeQuality}`);
console.log(` Implementation Quality: ${pkg.scores.implementationQuality}`);
console.log(` Grade: ${pkg.grade}`);
}
});
// Save detailed report to file
const fs = require('fs');
fs.writeFileSync(
'analysis-report.json',
JSON.stringify(result, null, 2)
);
} catch (error) {
console.error('Analysis failed:', error);
}
}
analyzeFullStack().catch(console.error);
The analyzer performs multiple levels of analysis:
The analyzer generates detailed reports in the following structure:
{
"passed": true,
"summary": {
"totalScore": 85,
"averageScore": 85,
"grade": "B"
},
"details": {
"dependencies": [],
"implementation": [],
"codeQuality": [],
"suggestions": []
}
}
Built-in analysis patterns for:
Add custom patterns by extending the configuration:
const customPatterns = {
'packageName': {
filePatterns: ['.ext1', '.ext2'],
codePatterns: ['import pattern', 'require pattern']
}
};
Contributions are welcome! Please feel free to submit a Pull Request. See our contributing guidelines for more details.
MIT License - see LICENSE file for details.
Tom Tarpey
⚠️ Important: Never commit API keys or tokens to version control. Use environment variables or secure configuration management for sensitive credentials.
For detailed API documentation and advanced usage examples, visit our documentation.
FAQs
Analyze GitHub repositories for package implementation and code quality
The npm package github-package-analyzer receives a total of 1 weekly downloads. As such, github-package-analyzer popularity was classified as not popular.
We found that github-package-analyzer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.