npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pkg-uninstaller-cli

v1.2.0

Published

A CLI tool to uninstall Node.js packages interactively

Downloads

3

Readme

Pkg-Uninstaller CLI

NPM Downloads

A lightweight and interactive CLI tool for uninstalling Node.js packages in bulk directly from your package.json.

Features

  • Detects installed dependencies from dependencies, devDependencies, peerDependencies, and optionalDependencies.
  • Supports npm, yarn, and pnpm package managers.
  • Batch uninstallation of selected packages for optimal performance.
  • Fully interactive command-line interface using inquirer.
  • Automatically detects the package manager in use.

Installation

Install the pkg-uninstaller-cli globally using npm:

npm install -g pkg-uninstaller-cli

Or using yarn:

yarn global add pkg-uninstaller-cli

Usage

Currently, the tool has two main commands:

  • pkg-uninstaller uninstall: Uninstall selected packages interactively.
  • pkg-uninstaller analyze: Analyze and identify unused dependencies in the project.

Uninstall Command

Navigate to the project directory containing your package.json file and run the following command:

pkg-uninstaller uninstall

You can also use the shorthand command:

pkg-u uninstall

You can also use the tool without installing it globally by using npx:

npx pkg-uninstaller-cli uninstall

Example Workflow

  1. The tool lists all installed packages (from dependencies, devDependencies, etc.).
  2. You select multiple packages to uninstall using an interactive checkbox.
  3. The tool detects your package manager (npm or yarn) automatically.
  4. Packages are uninstalled in batches of 5 for efficiency.

Example Output

$ pkg-uninstaller uninstall
Detected package manager: npm
? Select packages to uninstall: (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ chalk
 ◉ lodash
 ◉ inquirer
Running: npm uninstall chalk lodash inquirer
Successfully uninstalled: chalk, lodash, inquirer
All batches processed.

Analyze Command

Navigate to the project directory containing your package.json file and run the following command:

pkg-uninstaller analyze

You can also use the shorthand command:

pkg-u analyze

You can also use the tool without installing it globally by using npx:

npx pkg-uninstaller-cli analyze

Options

  • -v, --verbose: Enable verbose logging for detailed output.

Example Workflow

  1. The tool analyzes your project and lists all unused dependencies.
  2. You can choose to uninstall the unused dependencies interactively.

Example Output

$ pkg-uninstaller analyze
The following dependencies appear to be unused:
- @react-native-community/datetimepicker
- @stream-io/flat-list-mvcp
✔ Would you like to uninstall unused dependencies? Yes
Detected package manager: npm
Running: npm uninstall @react-native-community/datetimepicker @stream-io/flat-list-mvcp
Successfully uninstalled: @react-native-community/datetimepicker @stream-io/flat-list-mvcp
All batches processed.

Configuration File

You can use a configuration file named .pkg-uninstaller.json to specify dependencies to ignore during the analysis.

Configuration Format

Create a .pkg-uninstaller.json file in the root of your project with the following format:

{
  "ignoreDependencies": ["dependency1", "dependency2"]
}

Example Configuration

{
  "ignoreDependencies": [
    "expo-build-properties",
    "expo-dev-client",
    "expo-system-ui",
    "patch-package"
  ]
}

The tool will automatically read the .pkg-uninstaller.json file and ignore the specified dependencies during the analysis.

Requirements

  • Node.js v14.0.0 or higher
  • npm or yarn installed

Visual Studio Code Extension

There is also a Visual Studio Code extension version of this project available. You can find it at:

  • GitHub: https://github.com/theBGuy/vs-pkg-uninstaller
  • Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=theBGuy.pkguninstaller

How It Works

  1. Reads the package.json in the current working directory.
  2. Detects installed packages across all dependency types.
  3. Provides an interactive interface for selecting packages.
  4. Executes uninstallation commands in batches to enhance performance.

Future Improvements

Planned features include:

  • Undo Uninstall: Restore recently uninstalled packages.
  • Search and Filter: Easily search for packages by name before selecting.
  • Custom Batch Sizes: Allow users to configure batch sizes for uninstallation.
  • Progress Indicators: Display progress bars for ongoing tasks.

Contributing

Contributions are welcome! Feel free to fork the repository and open a pull request with your improvements.

  1. Fork the repository.
  2. Create a new branch for your feature or fix.
  3. Submit a pull request explaining your changes.

License

This project is licensed under the MIT License.