
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
dep-sweeper
Advanced tools
Analyze a project and remove unused dependencies, devDependencies, or duplicate versions across monorepos. Check for compatible dependencies.
๐งน A powerful tool to analyze and clean up your project dependencies. Remove unused dependencies, find duplicates across monorepos, and check for compatibility issues.
# Global installation
npm install -g dep-sweeper
# Local installation
npm install --save-dev dep-sweeper
# Analyze current directory
dep-sweeper analyze
# Analyze specific directory
dep-sweeper analyze ./my-project
# Remove unused dependencies (dry run by default)
dep-sweeper clean
# Automatically remove unused dependencies
dep-sweeper clean --auto
# Apply changes after review
dep-sweeper clean --apply
# Fix duplicate versions automatically
dep-sweeper fix-duplicates --auto
# Fix compatibility issues automatically
dep-sweeper fix-compatibility --auto
# Auto-fix everything (unused, duplicates, compatibility)
dep-sweeper auto-fix --auto
# Check for duplicates in monorepo
dep-sweeper duplicates
# Check compatibility
dep-sweeper compatibility
# Full analysis with all checks
dep-sweeper audit
dep-sweeper can automatically fix issues without manual intervention:
# Auto-fix everything in one command
dep-sweeper auto-fix --auto
# Fix only unused dependencies automatically
dep-sweeper clean --auto
# Fix only duplicate versions
dep-sweeper fix-duplicates --auto
# Fix only compatibility issues
dep-sweeper fix-compatibility --auto
--apply
: Apply changes instead of dry run--ignore <patterns>
: Ignore specific packages or patterns--include-dev
: Include devDependencies in analysis--verbose
: Show detailed output--format <type>
: Output format (json, table, csv)import { DepCleaner } from 'dep-sweeper';
const cleaner = new DepCleaner({
projectPath: './my-project',
includeDev: true
});
// Analyze unused dependencies
const analysis = await cleaner.analyzeUnused();
console.log(analysis);
// Find duplicates
const duplicates = await cleaner.findDuplicates();
console.log(duplicates);
// Check compatibility
const compatibility = await cleaner.checkCompatibility();
console.log(compatibility);
Create a .dep-sweeper.json
file in your project root:
{
"ignore": ["react", "@types/*"],
"includeDev": true,
"monorepo": {
"type": "lerna",
"workspaces": ["packages/*"]
},
"compatibility": {
"strict": false,
"checkPeerDeps": true
}
}
# Navigate to your project
cd my-project
# Run analysis
dep-sweeper analyze
# Auto-fix all issues
dep-sweeper auto-fix --auto
# Or clean unused dependencies manually
dep-sweeper clean --apply
# Auto-fix duplicates across workspaces
dep-sweeper fix-duplicates --auto
# Or check and manually fix duplicates
dep-sweeper duplicates --verbose
dep-sweeper fix-duplicates --apply
๐ Analyzing dependencies...
๐ฆ Found 3 unused dependencies:
โ lodash (4.17.21) - Last used: never
โ moment (2.29.4) - Last used: never
โ axios (0.27.2) - Last used: never
๐พ Potential savings: 2.3MB
๐ง Run with --apply to remove unused dependencies
๐ Checking for duplicates across workspaces...
๐ฆ Found 2 duplicate packages:
โ ๏ธ react
โโโ packages/web: 18.2.0
โโโ packages/mobile: 17.0.2
โโโ packages/shared: 18.1.0
โ ๏ธ typescript
โโโ packages/api: 4.8.4
โโโ packages/web: 4.9.3
MIT ยฉ [Your Name]
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
FAQs
Analyze a project and remove unused dependencies, devDependencies, or duplicate versions across monorepos. Check for compatible dependencies.
We found that dep-sweeper 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last weekโs supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.