ghost-amt
v1.0.0
Published
๐ป ghost-amt is a powerful and interactive CLI tool to detect and remove unused, bloated, or duplicate npm dependencies in your Node.js projects.
Maintainers
Readme
๐ป ghost-amt
Find and clean up unused npm dependencies in your Node.js projects โ quickly and safely.
๐ Features
- ๐ Detects unused dependencies and devDependencies in your project
- โ ๏ธ Warns about large packages (>1MB) that might bloat your app
- ๐ค Interactive CLI with colorful output and emojis
- ๐งน Prompt to uninstall unused packages with confirmation
- ๐ Fast, zero-config scanning powered by
depcheck - ๐ป Works with JavaScript and TypeScript projects
๐ฆ Installation
Install globally to use anywhere:
npm install -g ghost-amtOr run without installing:
npx ghost-amt๐งโโ๏ธ Usage
Run ghost-amt inside your project root folder:
ghost-amtYouโll see an output like this:
๐ป Welcome to ghost-amt - Find and clean up unused npm dependencies
๐ Scanning project for unused dependencies...
โ
Project scan completed!
๐ Scan Results Summary:
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Type โ Package Name โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Unused Dependency โ lodash โ
โ Unused DevDependency โ jest โ
โ Large Package (>1MB) โ puppeteer โ
โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐งฎ Total: 2 unused packages, 1 large package
? Do you want to remove all 2 unused packages? (y/N)โ๏ธ How It Works
- Static code analysis: Scans your codebase to detect which dependencies are actually imported or required.
- Package size detection: Checks installed package sizes to identify potentially heavy dependencies.
- Interactive removal: Prompts you to safely uninstall unused packages with your confirmation.
โ Limitations
- May miss dynamic imports or requires (e.g.,
require(variable)). - Does not modify your source code; only cleans
package.jsonandnode_modules. - Some build tools or scripts may cause false positives.
๐ Advanced Usage
Run in CI mode (non-interactive)
ghost-amt --ciGenerate report without uninstall prompt
ghost-amt --report-only๐ค Contributing
Contributions are very welcome!
- Fork the repo
- Create a feature branch (
git checkout -b feature-name) - Commit your changes (
git commit -m "Add feature") - Push to your branch (
git push origin feature-name) - Open a Pull Request
๐ License
MIT ยฉ Abdullah Al Mubin
๐ค Author
Abdullah Al Mubin
