0.6.3 โ€ข Published 6 months ago

depsweep v0.6.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

DepSweep ๐Ÿงน

Automated dependency cleanup and impact analysis report

npm version Downloads License

Features

Automatically detect and remove unused dependencies

  • ๐Ÿ” Smart Detection: Analyzes your codebase to find unused dependencies.
  • ๐ŸŽฏ AST-Based Analysis: Uses Abstract Syntax Tree parsing for precise detection.
  • ๐Ÿš€ Modern JS/TS Support: Supports the latest JavaScript and TypeScript features.
  • ๐Ÿ“ฆ Package Manager Compatibility: Works with npm, yarn, and pnpm.
  • ๐Ÿ›ก๏ธ Safe Mode: Prevents accidental removal of specified dependencies.
  • ๐Ÿ—๏ธ Monorepo Support: Seamlessly handles projects within monorepos.
  • โšก Efficient Processing: Utilizes parallel processing for faster analysis.
  • ๐Ÿงฉ Config File Scanning: Detects dependencies used in configuration files.
  • ๐Ÿ”ง Customizable Ignoring: Allows specifying directory patterns to exclude from scanning.
  • ๐Ÿง  Memory Management: Efficiently manages memory usage during analysis.
  • ๐Ÿ† Impact Reporting: See the impact of removing unused dependencies.

Supports:

  • โœ… ES Modules and CommonJS
  • โœ… TypeScript and JSX
  • โœ… Dynamic Imports
  • โœ… Configuration Files
  • โœ… Workspace Dependencies
  • โœ… Binary File Detection
  • โœ… Monorepos

Usage

Single Run

# Using npx
npx depsweep

# Using yarn
yarn dlx depsweep

# Using pnpm
pnpm dlx depsweep

Install

# Using npm
npm install -g depsweep

# Using yarn
yarn global add depsweep

# Using pnpm
pnpm add -g depsweep

Options

  -v, --verbose          Display detailed usage information
  -a, --aggressive       Allow removal of protected dependencies
  -s, --safe <deps>      Dependencies that will not be removed
  -i, --ignore <paths>   Patterns to ignore during scanning
  -m, --measure-impact   Measure unused dependency impact
  -d, --dry-run              Run without making changes
  -n, --no-progress          Disable the progress bar
  --version              Display installed version
  -h, --help             Display help information

Examples

# Run with verbose output
depsweep --verbose

# Specify dependencies to protect
depsweep --safe react react-dom

# Ignore specific directories or files
depsweep -i "test/**" "scripts/**"

# Preview changes without removing dependencies
depsweep --dry-run

Protected Dependencies

A list of protected dependencies are ignored by default to prevent accidental removal. Use the -a, --aggressive flag to override this protection. Combine with the -s, --safe flag to enable removal for only some protected dependencies.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

License

MIT ยฉ chief mikey

0.6.3

6 months ago

0.6.2

6 months ago

0.5.0

6 months ago

0.6.1

6 months ago

0.6.0

6 months ago

0.5.1

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.3.0

6 months ago

0.3.2

6 months ago

0.3.1

6 months ago

0.2.0

7 months ago

0.1.0

7 months ago

0.0.1

7 months ago