Ghoster is a Visual Studio Code extension that helps you keep your package.json
clean by detecting and highlighting unused dependencies in your JavaScript and TypeScript projects.
- π Real-time detection of unused dependencies
- π¨ Highlights unused dependencies directly in your
package.json
file - π Efficient file watching and analysis
- π§ Smart parsing of JavaScript, TypeScript, and JSON files
- π§ Customizable ignored dependencies
Ghoster currently supports:
- File types: .js, .jsx, .ts, .tsx
- Import style: ECMAScript modules (e.g.,
import x from 'y'
)
Note: CommonJS require()
statements are not currently supported.
- Open Visual Studio Code
- Press
Ctrl+P
(orCmd+P
on macOS) to open the Quick Open dialog - Type
ext install ghoster
and press Enter - Click the Install button
Once installed, Ghoster will automatically start analyzing your project:
- Open a JavaScript or TypeScript project in VSCode
- Open your
package.json
file - Unused dependencies will be highlighted with a ghostly message π»
The extension will continuously monitor your files for changes and update the highlights in real-time.
Ghoster adds the following command to the Command Palette:
Ghoster: Highlight Unused Dependencies
: Manually trigger the analysis of unused dependencies
You can customize Ghoster by modifying your VSCode settings.json
:
{
"ghoster.ignore": ["some-package-to-ignore", "another-package-to-ignore"]
}
This setting allows you to specify dependencies that should be ignored by Ghoster, even if they appear to be unused.
Ghoster uses a smart file watching system to detect changes in your project files. When a file is modified, created, or deleted, Ghoster analyzes only the affected file, maintaining an up-to-date dependency tree without unnecessary full project scans.
We welcome contributions to Ghoster! If you have suggestions for improvements or bug fixes, please feel free to open an issue or submit a pull request on our GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any problems or have any questions, please open an issue on our GitHub repository.
Happy coding, and may your dependencies always be lean and mean! π»π»